fixes in tree loading

This commit is contained in:
azivner
2018-08-12 12:59:38 +02:00
parent af4ea66742
commit 27be3b4c90
3 changed files with 5 additions and 5 deletions

View File

@@ -35,9 +35,9 @@ async function getTree() {
JOIN tree ON branches.parentNoteId = tree.noteId
WHERE tree.isExpanded = 1 AND branches.isDeleted = 0
)
SELECT branches.* FROM tree JOIN branches USING(noteId) ORDER BY branches.notePosition`);
SELECT branches.* FROM tree JOIN branches USING(noteId) WHERE branches.isDeleted = 0 ORDER BY branches.notePosition`);
const noteIds = branches.map(b => b.noteId);
const noteIds = Array.from(new Set(branches.map(b => b.noteId)));
const notes = await getNotes(noteIds);