From 5063cfb979ca7db1d8775d701b68e4741d423fd9 Mon Sep 17 00:00:00 2001 From: Arne Date: Tue, 1 Oct 2019 21:40:57 +0200 Subject: [PATCH] BackendAPI: Return Note created within createNoteAndRefresh (#647) (cherry picked from commit 334a38c493c19d207e25113c1d18493b812d26d1) --- src/services/backend_script_api.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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;