note expansion is not synced anymore so there's less possibility of conflict

This commit is contained in:
azivner 2017-11-07 20:36:17 -05:00
parent 0f11eb9e98
commit 70f717b350

View file

@ -84,13 +84,9 @@ router.put('/:noteId/moveAfter/:afterNoteId', async (req, res, next) => {
router.put('/:noteId/expanded/:expanded', async (req, res, next) => {
const noteId = req.params.noteId;
const expanded = req.params.expanded;
const now = utils.nowTimestamp();
await sql.doInTransaction(async () => {
await sql.execute("update notes_tree set is_expanded = ?, date_modified = ? where note_id = ?", [expanded, now, noteId]);
await sql.addNoteTreeSync(noteId);
await sql.addAudit(audit_category.CHANGE_EXPANDED, utils.browserId(req), noteId, null, expanded);
await sql.execute("update notes_tree set is_expanded = ? where note_id = ?", [expanded, noteId]);
});
res.send({});