refactoring of note deletion

This commit is contained in:
azivner
2018-03-31 23:08:22 -04:00
parent 4f200c73dc
commit 12439d8761
9 changed files with 46 additions and 36 deletions

View File

@@ -2,11 +2,16 @@
const Entity = require('./entity');
const utils = require('../services/utils');
const repository = require('../services/repository');
class Branch extends Entity {
static get tableName() { return "branches"; }
static get primaryKeyName() { return "branchId"; }
async getNote() {
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
}
beforeSaving() {
this.dateModified = utils.nowDate()
}