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

@@ -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>