link fixes

This commit is contained in:
zadam
2019-08-19 20:19:42 +02:00
parent 3cb421143f
commit c9d0b8cc40
3 changed files with 4 additions and 60 deletions

View File

@@ -9,12 +9,12 @@ async function getRelations(noteIds, relationNames) {
WHERE (noteId IN (???) OR value IN (???))
AND type = 'relation'
AND isDeleted = 0
`, Array.from(noteIds))).filter(l => relationNames.includes(l.name));
`, Array.from(noteIds)));
}
async function getLinkMap(req) {
const {noteId} = req.params;
const {relationNames, maxNotes, maxDepth} = req.body;
const {maxNotes, maxDepth} = req.body;
let noteIds = new Set([noteId]);
let relations;
@@ -22,7 +22,7 @@ async function getLinkMap(req) {
let depth = 0;
while (true) {
relations = await getRelations(noteIds, relationNames);
relations = await getRelations(noteIds);
if (depth === maxDepth) {
break;