removed notes_parent, instead using notes_tree

This commit is contained in:
azivner
2017-11-19 11:28:46 -05:00
parent b22eb2db1e
commit f18d25911b
5 changed files with 69 additions and 60 deletions

View File

@@ -21,13 +21,6 @@ router.get('/', auth.checkApiAuth, async (req, res, next) => {
+ "where notes.is_deleted = 0 and notes_tree.is_deleted = 0 "
+ "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);
for (const note of notes) {
@@ -38,7 +31,6 @@ 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()
});