script related changes

This commit is contained in:
azivner
2018-01-29 20:57:55 -05:00
parent 587f3d833e
commit 9a091408e3
4 changed files with 15 additions and 25 deletions

View File

@@ -3,6 +3,14 @@
const Entity = require('./entity');
class Note extends Entity {
constructor(sql, row) {
super(sql, row);
if (this.type === "code" && this.mime === "application/json") {
this.jsonContent = JSON.parse(this.content);
}
}
async getAttributes() {
return this.sql.getEntities("SELECT * FROM attributes WHERE noteId = ?", [this.noteId]);
}