mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 16:00:54 +08:00
a7e9c0c776
- Updated enum values to be uppercase - Updated services to expose service models - Updated models to only export the mongoose model - Moved all mongoose static methods over to new services - Updated tests to refelct new setup BREAKING - Status that were uppercased (caps) have caused issues with the admin pages
27 lines
516 B
JavaScript
27 lines
516 B
JavaScript
const express = require('express');
|
|
const SettingsService = require('../../../services/settings');
|
|
|
|
const router = express.Router();
|
|
|
|
router.get('/', (req, res, next) => {
|
|
SettingsService
|
|
.retrieve().then((settings) => {
|
|
res.json(settings);
|
|
})
|
|
.catch((err) => {
|
|
next(err);
|
|
});
|
|
});
|
|
|
|
router.put('/', (req, res, next) => {
|
|
SettingsService
|
|
.update(req.body).then(() => {
|
|
res.status(204).end();
|
|
})
|
|
.catch((err) => {
|
|
next(err);
|
|
});
|
|
});
|
|
|
|
module.exports = router;
|