Skip to content

Build your personal knowledge base with Trilium Notes

Merge branch 'm38'

zadamf921562346f3
diff --cc src/routes/api/notes.js
index f0c7cb228a,330bf8182a..29b0b6849a
--- a/src/routes/api/notes.js
+++ b/src/routes/api/notes.js
@@@ -53,12 -53,14 +53,14 @@@ async function getChildren(req)
}
async function createNote(req) {
- const parentNoteId = req.params.parentNoteId;
- const newNote = req.body;
+ const params = Object.assign({}, req.body); // clone
+ params.parentNoteId = req.params.parentNoteId;
+
+ const { target, targetBranchId } = req.query;
- const { note, branch } = await noteService.createNewNote(parentNoteId, newNote, req);
+ const { note, branch } = await noteService.createNewNoteWithTarget(target, targetBranchId, params);
- note.cssClass = (await note.getLabels("cssClass")).map(label => label.value).join(" ");
+ await treeService.setCssClassesToNotes([note]);
return {
note,