terseness

This commit is contained in:
Riley Davis
2016-11-03 11:33:32 -06:00
parent 73be4cfe28
commit c2d4e1255b
2 changed files with 10 additions and 12 deletions
+2 -10
View File
@@ -4,19 +4,11 @@ const path = require('path');
const Setting = require(path.resolve(__dirname, 'models/setting'));
router.get('/settings', (req, res, next) => {
Setting.getSettings().then(settings => {
res.json(settings);
}).catch(error => {
next(error);
});
Setting.getSettings().then(res.json).catch(next);
});
router.put('/settings', (req, res, next) => {
Setting.updateSettings(req.body).then(updatedSettings => {
res.json(updatedSettings);
}).catch(error => {
next(error);
});
Setting.updateSettings(req.body).then(res.json).catch(next);
});
module.exports = router;