branches in tree cache should always be loaded if some branchId reference exists

This commit is contained in:
zadam
2019-10-26 09:58:00 +02:00
parent ed9ecf2a57
commit d3c957768f
10 changed files with 25 additions and 43 deletions

View File

@@ -99,15 +99,7 @@ async function getTree() {
}
async function load(req) {
let noteIds = req.body.noteIds;
const branchIds = req.body.branchIds;
if (branchIds && branchIds.length > 0) {
noteIds = (await sql.getManyRows(`SELECT noteId FROM branches WHERE isDeleted = 0 AND branchId IN(???)`, branchIds))
.map(note => note.noteId);
}
return await getNotesAndBranches(noteIds);
return await getNotesAndBranches(req.body.noteIds);
}
module.exports = {