create note from API/import etc. should allow empty title, fixes #2530

This commit is contained in:
zadam 2022-01-08 19:33:56 +01:00
parent 82ba0d5b1d
commit b90ba3d1a9

View File

@ -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(() => {