From 35e47f866a349490664d55d0835f404cb4810334 Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 11 Dec 2020 15:27:57 +0100 Subject: [PATCH] fix root branch --- src/routes/api/tree.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/routes/api/tree.js b/src/routes/api/tree.js index 3a5a4b21b..2a36b40b0 100644 --- a/src/routes/api/tree.js +++ b/src/routes/api/tree.js @@ -26,6 +26,17 @@ function getNotesAndBranchesAndAttributes(noteIds) { JOIN notes AS child ON child.noteId = branches.noteId WHERE branches.isDeleted = 0`); + if (noteIds.has('root')) { + branches.push({ + branchId: 'root', + noteId: 'root', + parentNoteId: 'none', + notePosition: 0, + prefix: '', + isExpanded: true + }); + } + const attributes = sql.getRows(` SELECT attributes.attributeId,