note type context submenu now works end to end

This commit is contained in:
zadam
2019-03-17 12:19:23 +01:00
parent 177caec011
commit 33f2aaa650
6 changed files with 61 additions and 49 deletions

View File

@@ -81,10 +81,6 @@ async function createNewNote(parentNoteId, noteData) {
noteData.type = noteData.type || parentNote.type;
noteData.mime = noteData.mime || parentNote.mime;
if (noteData.type === 'text' || noteData.type === 'code') {
noteData.content = noteData.content || "";
}
const note = await new Note({
noteId: noteData.noteId, // optionally can force specific noteId
title: noteData.title,
@@ -93,6 +89,10 @@ async function createNewNote(parentNoteId, noteData) {
mime: noteData.mime || 'text/html'
}).save();
if (note.isStringNote()) {
noteData.content = noteData.content || "";
}
note.noteContent = await new NoteContent({
noteId: note.noteId,
content: noteData.content