Link entity migrated to Attribute, WIP

This commit is contained in:
zadam
2019-08-19 20:12:00 +02:00
parent fd9b79e115
commit 3cb421143f
22 changed files with 172 additions and 174 deletions

View File

@@ -628,10 +628,17 @@ class Note extends Entity {
/**
* Get list of links coming out of this note.
*
* @returns {Promise<Link[]>}
* @deprecated - not intended for general use
* @returns {Promise<Attribute[]>}
*/
async getLinks() {
return await repository.getEntities("SELECT * FROM links WHERE noteId = ? AND isDeleted = 0", [this.noteId]);
return await repository.getEntities(`
SELECT *
FROM attributes
WHERE noteId = ? AND
isDeleted = 0 AND
type = 'relation' AND
name IN ('internal-link', 'image-link', 'relation-map-link')`, [this.noteId]);
}
/**