mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
added some consistency checks for links and attributes
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user