per-browser source id so we support having notecase opened in multiple tabs/windows

This commit is contained in:
azivner
2017-12-16 20:48:34 -05:00
parent 03d86209ca
commit 50ff5da947
17 changed files with 98 additions and 83 deletions

View File

@@ -25,10 +25,12 @@ router.get('/:noteId', auth.checkApiAuth, async (req, res, next) => {
});
router.put('', auth.checkApiAuth, async (req, res, next) => {
const sourceId = req.headers.source_id;
await sql.doInTransaction(async () => {
await sql.replace("notes_history", req.body);
await sync_table.addNoteHistorySync(req.body.note_history_id);
await sync_table.addNoteHistorySync(req.body.note_history_id, sourceId);
});
res.send();