incremental push sync

This commit is contained in:
azivner
2017-10-29 22:22:30 -04:00
parent de3d1b3e39
commit 8630b3685d
3 changed files with 142 additions and 71 deletions

View File

@@ -35,8 +35,20 @@ router.get('/note/:noteId/:since', auth.checkApiAuth, async (req, res, next) =>
res.send(await sync.getNoteSince(noteId, since));
});
router.put('/note', auth.checkApiAuth, async (req, res, next) => {
await sync.putNote(req.body);
router.put('/notes', auth.checkApiAuth, async (req, res, next) => {
await sync.updateNote(req.body);
res.send({});
});
router.put('/notes_tree', auth.checkApiAuth, async (req, res, next) => {
await sync.updateNoteTree(req.body);
res.send({});
});
router.put('/notes_history', auth.checkApiAuth, async (req, res, next) => {
await sync.updateNoteHistory(req.body);
res.send({});
});