refactoring of note creation APIs WIP

This commit is contained in:
zadam
2019-11-16 11:09:52 +01:00
parent de02e9e889
commit 13c0411533
13 changed files with 115 additions and 107 deletions

View File

@@ -53,10 +53,10 @@ 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 { note, branch } = await noteService.createNewNote(parentNoteId, newNote, req);
const { note, branch } = await noteService.createNewNote(params);
note.cssClass = (await note.getLabels("cssClass")).map(label => label.value).join(" ");