refactoring of note creation APIs WIP

This commit is contained in:
zadam
2019-11-16 17:00:22 +01:00
parent 60231de0ed
commit 3d294c5163
3 changed files with 13 additions and 1 deletions

View File

@@ -114,6 +114,10 @@ class Note extends Entity {
/** @returns {Promise} */
async setContent(content) {
if (content === null || content === undefined) {
throw new Error(`Cannot set null content to note ${this.noteId}`);
}
// force updating note itself so that dateModified is represented correctly even for the content
this.forcedChange = true;
this.contentLength = content.length;