mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
parent-child relationship is now stored in notes_parent table
This commit is contained in:
@@ -19,7 +19,14 @@ router.get('/', auth.checkApiAuth, async (req, res, next) => {
|
||||
+ "from notes_tree "
|
||||
+ "join notes on notes.note_id = notes_tree.note_id "
|
||||
+ "where notes.is_deleted = 0 and notes_tree.is_deleted = 0 "
|
||||
+ "order by note_pid, note_pos");
|
||||
+ "order by note_pos");
|
||||
|
||||
const notes_parent = await sql.getResults("" +
|
||||
"select parent_id, child_id " +
|
||||
"from notes_parent " +
|
||||
"join notes_tree as child on child.note_tree_id = notes_parent.child_id " +
|
||||
"left join notes_tree as parent on parent.note_tree_id = notes_parent.parent_id " +
|
||||
"where child.is_deleted = 0 and (parent.is_deleted = 0 or notes_parent.parent_id = 'root')");
|
||||
|
||||
const dataKey = protected_session.getDataKey(req);
|
||||
|
||||
@@ -31,6 +38,7 @@ router.get('/', auth.checkApiAuth, async (req, res, next) => {
|
||||
|
||||
res.send({
|
||||
notes: notes,
|
||||
notes_parent: notes_parent,
|
||||
start_note_tree_id: await options.getOption('start_note_tree_id'),
|
||||
tree_load_time: utils.nowTimestamp()
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user