added sync for recent notes

This commit is contained in:
azivner
2017-11-05 00:16:02 -04:00
parent 3fb30a0b5c
commit ae23f2ea84
6 changed files with 48 additions and 6 deletions

View File

@@ -59,6 +59,12 @@ router.get('/notes_reordering/:noteParentId', auth.checkApiAuth, async (req, res
});
});
router.get('/recent_notes/:noteId', auth.checkApiAuth, async (req, res, next) => {
const noteId = req.params.noteId;
res.send(await sql.getSingleResult("SELECT * FROM recent_notes WHERE note_id = ?", [noteId]));
});
router.put('/notes', auth.checkApiAuth, async (req, res, next) => {
await sync.updateNote(req.body.entity, req.body.links, req.body.sourceId);
@@ -89,4 +95,10 @@ router.put('/options', auth.checkApiAuth, async (req, res, next) => {
res.send({});
});
router.put('/recent_notes', auth.checkApiAuth, async (req, res, next) => {
await sync.updateRecentNotes(req.body.entity, req.body.sourceId);
res.send({});
});
module.exports = router;