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

@@ -0,0 +1,15 @@
"use strict";
const Entity = require('./entity');
const repository = require('../services/repository');
class NoteImage extends Entity {
static get tableName() { return "note_images"; }
static get primaryKeyName() { return "noteImageId"; }
async getNote() {
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
}
}
module.exports = NoteImage;