diff --git a/apps/server/src/routes/api/branches.ts b/apps/server/src/routes/api/branches.ts index bed1c93b7a..4cd570fcb0 100644 --- a/apps/server/src/routes/api/branches.ts +++ b/apps/server/src/routes/api/branches.ts @@ -163,6 +163,7 @@ function setExpandedForSubtree(req: Request) { SELECT branches.branchId, branches.noteId FROM branches JOIN tree ON branches.parentNoteId = tree.noteId WHERE branches.isDeleted = 0 + AND branches.isExpanded = 1 ) SELECT branchId FROM tree`, [branchId]