refactoring of note update

This commit is contained in:
azivner
2018-03-31 22:15:06 -04:00
parent e8a5d0ae16
commit 5f7e74e15c
7 changed files with 103 additions and 124 deletions

View File

@@ -1,5 +1,6 @@
const Note = require('../entities/note');
const NoteRevision = require('../entities/note_revision');
const NoteImage = require('../entities/note_image');
const Branch = require('../entities/branch');
const Label = require('../entities/label');
const repository = require('../services/repository');
@@ -13,6 +14,9 @@ function createEntityFromRow(row) {
else if (row.noteRevisionId) {
entity = new NoteRevision(row);
}
else if (row.noteImageId) {
entity = new NoteImage(row);
}
else if (row.branchId) {
entity = new Branch(row);
}