diff --git a/src/routes/api/tree.js b/src/routes/api/tree.js index 53578079a..3a5a4b21b 100644 --- a/src/routes/api/tree.js +++ b/src/routes/api/tree.js @@ -22,7 +22,7 @@ function getNotesAndBranchesAndAttributes(noteIds) { branches.prefix, branches.isExpanded FROM param_list - JOIN branches ON param_list.paramId = branches.noteId OR param_list.paramId = branches.parentNoteId + JOIN branches ON param_list.paramId = branches.parentNoteId JOIN notes AS child ON child.noteId = branches.noteId WHERE branches.isDeleted = 0`); diff --git a/src/services/entity_changes.js b/src/services/entity_changes.js index 4cdec8920..576a0a40f 100644 --- a/src/services/entity_changes.js +++ b/src/services/entity_changes.js @@ -116,7 +116,7 @@ function fillAllEntityChanges() { } module.exports = { - addNoteReorderingEntityChange: (parentNoteId, sourceId) => addEntityChange("note_reordering", parentNoteId, sourceId), + addNoteReorderingEntityChange: (parentNoteId, sourceId) => addEntityChange("note_reordering", parentNoteId, '', sourceId), moveEntityChangeToTop, addEntityChange, fillAllEntityChanges, diff --git a/src/services/sql.js b/src/services/sql.js index 1f8ae1be2..e825113b4 100644 --- a/src/services/sql.js +++ b/src/services/sql.js @@ -219,7 +219,7 @@ function wrap(query, func) { log.info(`Slow recursive query took ${milliseconds}ms.`); } else { - log.info(`Slow query took ${milliseconds}ms: ${query}`); + log.info(`Slow query took ${milliseconds}ms: ${query.trim().replace(/\s+/g, " ")}`); } }