added some consistency checks for links and attributes

This commit is contained in:
azivner
2018-11-15 13:58:14 +01:00
parent 346b8c21dd
commit 6749cbed1b
36 changed files with 244 additions and 47 deletions

View File

@@ -499,12 +499,23 @@ class Note extends Entity {
}
/**
* Get list of links coming out of this note.
*
* @returns {Promise<Link[]>}
*/
async getLinks() {
return await repository.getEntities("SELECT * FROM links WHERE noteId = ? AND isDeleted = 0", [this.noteId]);
}
/**
* Get list of links targetting this note.
*
* @returns {Promise<Link[]>}
*/
async getTargetLinks() {
return await repository.getEntities("SELECT * FROM links WHERE targetNoteId = ? AND isDeleted = 0", [this.noteId]);
}
/**
* Return all links from this note, including deleted ones.
*