mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
terseness
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user