From 8bf4633cd0799c4bb770ba3726bf3b7f09407d52 Mon Sep 17 00:00:00 2001 From: azivner Date: Wed, 30 May 2018 23:18:56 -0400 Subject: [PATCH] fixes --- src/routes/api/import.js | 4 ++++ src/routes/api/tree.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/api/import.js b/src/routes/api/import.js index f37276502..8fea221f4 100644 --- a/src/routes/api/import.js +++ b/src/routes/api/import.js @@ -33,6 +33,10 @@ async function importToBranch(req) { } function toHtml(text) { + if (!text) { + return ''; + } + return '

' + text.replace(/(?:\r\n|\r|\n)/g, '

') + '

'; } diff --git a/src/routes/api/tree.js b/src/routes/api/tree.js index daeece1da..2696bd65e 100644 --- a/src/routes/api/tree.js +++ b/src/routes/api/tree.js @@ -56,7 +56,7 @@ async function load(req) { const branchIds = req.body.branchIds; if (branchIds && branchIds.length > 0) { - noteIds = (await sql.getColumn(`SELECT noteId FROM branches WHERE isDeleted = 0 AND branchId IN(???)`, branchIds)) + noteIds = (await sql.getManyRows(`SELECT noteId FROM branches WHERE isDeleted = 0 AND branchId IN(???)`, branchIds)) .map(note => note.noteId); }