note content refactoring, WIP

This commit is contained in:
zadam
2019-02-07 22:16:40 +01:00
parent c487a95bc7
commit 6952b643ae
4 changed files with 14 additions and 3 deletions

View File

@@ -74,6 +74,13 @@ class Note extends Entity {
return noteContent.content;
}
/** @returns {Promise<*>} */
async getJsonContent() {
const content = await this.getContent();
return JSON.parse(content);
}
/** @returns {boolean} true if this note is the root of the note tree. Root note has "root" noteId */
isRoot() {
return this.noteId === 'root';