|
|
|
|
@ -194,25 +194,6 @@ function BackendScriptApi(currentNote, apiParams) {
|
|
|
|
|
*/
|
|
|
|
|
this.createNote = noteService.createNewNote;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates new note according to given params and force all connected clients to refresh their tree.
|
|
|
|
|
*
|
|
|
|
|
* @method
|
|
|
|
|
*
|
|
|
|
|
* @param {string} parentNoteId - create new note under this parent
|
|
|
|
|
* @param {string} title
|
|
|
|
|
* @param {string} [content=""]
|
|
|
|
|
* @param {CreateNoteParams} [extraOptions={}]
|
|
|
|
|
* @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch
|
|
|
|
|
*/
|
|
|
|
|
this.createNoteAndRefresh = async function(parentNoteId, title, content, extraOptions) {
|
|
|
|
|
const ret = await noteService.createNewNote(parentNoteId, title, content, extraOptions);
|
|
|
|
|
|
|
|
|
|
ws.refreshTree();
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Log given message to trilium logs.
|
|
|
|
|
*
|
|
|
|
|
|