initial implementation of tree prefix

This commit is contained in:
azivner
2017-11-26 22:34:25 -05:00
parent b4e6245f7b
commit 160c1c455c
8 changed files with 9678 additions and 4 deletions

View File

@@ -48,4 +48,17 @@ router.put('/:noteId/protectSubTree/:isProtected', auth.checkApiAuth, async (req
res.send({});
});
router.put('/:noteTreeId/setPrefix', auth.checkApiAuth, async (req, res, next) => {
const noteTreeId = req.params.noteTreeId;
const prefix = req.body.prefix;
await sql.doInTransaction(async () => {
await sql.execute("UPDATE notes_tree SET prefix = ? WHERE note_tree_id = ?", [prefix, noteTreeId]);
await sync_table.addNoteTreeSync(noteTreeId);
});
res.send({});
});
module.exports = router;