fix collapse tree

This commit is contained in:
zadam
2021-02-04 23:08:16 +01:00
parent 6469937393
commit 397f0d1326
3 changed files with 7 additions and 4 deletions

View File

@@ -121,7 +121,8 @@ function moveBranchAfterNote(req) {
}
function setExpanded(req) {
const {branchId, expanded} = req.params;
const {branchId} = req.params;
const expanded = parseInt(req.params.expanded);
if (branchId !== 'root') {
sql.execute("UPDATE branches SET isExpanded = ? WHERE branchId = ?", [expanded, branchId]);
@@ -137,7 +138,8 @@ function setExpanded(req) {
}
function setExpandedForSubtree(req) {
const {branchId, expanded} = req.params;
const {branchId} = req.params;
const expanded = parseInt(req.params.expanded);
let branchIds = sql.getColumn(`
WITH RECURSIVE