mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 16:56:34 +01:00
added some consistency checks for links and attributes
This commit is contained in:
@@ -461,7 +461,7 @@ class Note extends Entity {
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds notes with given attribute name and value. Only own attributes are considered, not inherited ones
|
||||
* Finds child notes with given attribute name and value. Only own attributes are considered, not inherited ones
|
||||
*
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
@@ -527,12 +527,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.
|
||||
*
|
||||
@@ -640,7 +651,7 @@ module.exports = Note;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Nov 15 2018 13:33:27 GMT+0100 (Central European Standard Time)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
Reference in New Issue
Block a user