added basic infrastructure for attributes

This commit is contained in:
azivner
2018-01-09 22:09:45 -05:00
parent 58362405c6
commit b250ad593c
7 changed files with 54 additions and 2 deletions

View File

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