first experiments with note entity

This commit is contained in:
azivner
2018-01-28 23:16:50 -05:00
parent 52ad7f64b4
commit 9b53a17168
2 changed files with 25 additions and 0 deletions

17
src/entities/note.js Normal file
View File

@@ -0,0 +1,17 @@
"use strict";
class Note {
constructor(sql, row) {
this.sql = sql;
for (const key in row) {
this[key] = row[key];
}
}
async attributes() {
return this.sql.getAll("SELECT * FROM attributes WHERE noteId = ?", [this.noteId]);
}
}
module.exports = Note;