From b90ba3d1a9ad26e969f400db2f47b666cc2b3962 Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 8 Jan 2022 19:33:56 +0100 Subject: [PATCH] create note from API/import etc. should allow empty title, fixes #2530 --- src/services/notes.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/notes.js b/src/services/notes.js index c3afa563f..c7cd68b3d 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -102,8 +102,9 @@ function createNewNote(params) { throw new Error(`Parent note "${params.parentNoteId}" not found.`); } - if (!params.title || params.title.trim().length === 0) { - throw new Error(`Note title must not be empty`); + if (params.title === null || params.title === undefined) { + // empty title is allowed since it's possible to create such in the UI + throw new Error(`Note title must be set`); } return sql.transactional(() => {