links are now shown in the relation map as well

This commit is contained in:
azivner
2018-11-14 10:11:15 +01:00
parent 247275d391
commit fc9495bcdf
4 changed files with 43 additions and 5 deletions

View File

@@ -99,7 +99,8 @@ async function getRelationMap(req) {
noteTitles: {},
relations: [],
// relation name => mirror relation name
mirrorRelations: {}
mirrorRelations: {},
links: []
};
if (noteIds.length === 0) {
@@ -129,6 +130,16 @@ async function getRelationMap(req) {
}
}
resp.links = (await repository.getEntities(`SELECT * FROM links WHERE isDeleted = 0 AND noteId IN (${questionMarks})`, noteIds))
.filter(link => noteIds.includes(link.targetNoteId))
.map(link => {
return {
linkId: link.linkId,
sourceNoteId: link.noteId,
targetNoteId: link.targetNoteId
}
});
return resp;
}