diff --git a/src/services/backend_script_api.js b/src/services/backend_script_api.js index 377b58d4d..514f70416 100644 --- a/src/services/backend_script_api.js +++ b/src/services/backend_script_api.js @@ -209,9 +209,11 @@ function BackendScriptApi(currentNote, apiParams) { * @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch */ 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(); + + return note; }; /** @@ -315,4 +317,4 @@ function BackendScriptApi(currentNote, apiParams) { this.getAppInfo = () => appInfo } -module.exports = BackendScriptApi; \ No newline at end of file +module.exports = BackendScriptApi;