From 199d89c1a6ed7753a05987d508cdf5d01ffdbab1 Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 11 Dec 2020 15:24:44 +0100 Subject: [PATCH] optimizations and fixes --- src/routes/api/tree.js | 2 +- src/services/entity_changes.js | 2 +- src/services/sql.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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, " ")}`); } }