relation between notes and images

This commit is contained in:
azivner
2018-01-06 21:49:02 -05:00
parent 784cd62df1
commit c0e45a73a8
12 changed files with 117 additions and 7 deletions

View File

@@ -133,6 +133,12 @@ router.get('/images/:imageId', auth.checkApiAuth, async (req, res, next) => {
res.send(entity);
});
router.get('/notes_image/:noteImageId', auth.checkApiAuth, async (req, res, next) => {
const noteImageId = req.params.noteImageId;
res.send(await sql.getFirst("SELECT * FROM notes_image WHERE note_image_id = ?", [noteImageId]));
});
router.put('/notes', auth.checkApiAuth, async (req, res, next) => {
await syncUpdate.updateNote(req.body.entity, req.body.sourceId);
@@ -175,4 +181,10 @@ router.put('/images', auth.checkApiAuth, async (req, res, next) => {
res.send({});
});
router.put('/notes_image', auth.checkApiAuth, async (req, res, next) => {
await syncUpdate.updateNoteImage(req.body.entity, req.body.sourceId);
res.send({});
});
module.exports = router;