link map WIP

This commit is contained in:
zadam
2019-06-03 22:55:59 +02:00
parent 0a0663be69
commit 87b16f3325
10 changed files with 919 additions and 28 deletions

View File

@@ -1,17 +0,0 @@
"use strict";
const sql = require('../../services/sql');
async function getNoteLinks(req) {
const {noteId} = req.params;
return await sql.getRows(`
SELECT noteId, targetNoteId, type FROM links WHERE (noteId = ? OR targetNoteId = ?) AND isDeleted = 0
UNION
SELECT noteId, value, 'relation' FROM attributes WHERE (noteId = ? OR value = ?) AND type = 'relation' AND isDeleted = 0
`, [noteId, noteId, noteId, noteId]);
}
module.exports = {
getNoteLinks
};