mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	BackendAPI: Return Note created within createNoteAndRefresh (#647)
(cherry picked from commit 334a38c493c19d207e25113c1d18493b812d26d1)
This commit is contained in:
		
							parent
							
								
									0835930a8a
								
							
						
					
					
						commit
						5063cfb979
					
				@ -209,9 +209,11 @@ function BackendScriptApi(currentNote, apiParams) {
 | 
				
			|||||||
     * @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch
 | 
					     * @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    this.createNoteAndRefresh = async function(parentNoteId, title, content, extraOptions) {
 | 
					    this.createNoteAndRefresh = async function(parentNoteId, title, content, extraOptions) {
 | 
				
			||||||
        await noteService.createNote(parentNoteId, title, content, extraOptions);
 | 
					        const note = await noteService.createNote(parentNoteId, title, content, extraOptions);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ws.refreshTree();
 | 
					        ws.refreshTree();
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        return note;
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
@ -315,4 +317,4 @@ function BackendScriptApi(currentNote, apiParams) {
 | 
				
			|||||||
    this.getAppInfo = () => appInfo
 | 
					    this.getAppInfo = () => appInfo
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module.exports = BackendScriptApi;
 | 
					module.exports = BackendScriptApi;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user