split out note's content into separate entity, WIP

This commit is contained in:
zadam
2019-02-06 20:19:25 +01:00
parent 8b250ed523
commit 8884177d9f
18 changed files with 417 additions and 213 deletions

View File

@@ -1,4 +1,5 @@
const Note = require('../entities/note');
const NoteContent = require('../entities/note_content');
const NoteRevision = require('../entities/note_revision');
const Link = require('../entities/link');
const Branch = require('../entities/branch');
@@ -12,6 +13,7 @@ const ENTITY_NAME_TO_ENTITY = {
"attributes": Attribute,
"branches": Branch,
"notes": Note,
"note_contents": NoteContent,
"note_revisions": NoteRevision,
"recent_notes": RecentNote,
"options": Option,
@@ -48,6 +50,9 @@ function createEntityFromRow(row) {
else if (row.branchId) {
entity = new Branch(row);
}
else if (row.noteContentId) {
entity = new NoteContent(row);
}
else if (row.noteId) {
entity = new Note(row);
}