created repository object to access entities

This commit is contained in:
azivner
2018-01-29 23:17:44 -05:00
parent 9a091408e3
commit 6fa6891496
12 changed files with 104 additions and 95 deletions

View File

@@ -4,11 +4,11 @@ const Entity = require('./entity');
class NoteTree extends Entity {
async getNote() {
return this.sql.getEntity("SELECT * FROM note_tree WHERE isDeleted = 0 AND noteId = ?", [this.noteId]);
return this.repository.getEntity("SELECT * FROM note_tree WHERE isDeleted = 0 AND noteId = ?", [this.noteId]);
}
async getParentNote() {
return this.sql.getEntity("SELECT * FROM note_tree WHERE isDeleted = 0 AND parentNoteId = ?", [this.parentNoteId]);
return this.repository.getEntity("SELECT * FROM note_tree WHERE isDeleted = 0 AND parentNoteId = ?", [this.parentNoteId]);
}
}