happy path tar import now works

This commit is contained in:
azivner
2018-11-26 20:30:43 +01:00
parent 71eda5aa3d
commit 4d5a17583f
2 changed files with 50 additions and 21 deletions

View File

@@ -53,6 +53,10 @@ async function createNewNote(parentNoteId, noteData) {
const parentNote = await repository.getNote(parentNoteId);
if (!parentNote) {
throw new Error(`Parent note ${parentNoteId} not found.`);
}
if (!noteData.type) {
if (parentNote.type === 'text' || parentNote.type === 'code') {
noteData.type = parentNote.type;