New project structure
Beta of extract.js for extracting english locale
This commit is contained in:
parent
e18d2b2f84
commit
2edbd67205
247 changed files with 6405 additions and 4237 deletions
22
server/routes/rest/settings.js
Normal file
22
server/routes/rest/settings.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
'use strict';
|
||||
|
||||
const passport = require('../../lib/passport');
|
||||
const settings = require('../../models/settings');
|
||||
|
||||
const router = require('../../lib/router-async').create();
|
||||
|
||||
|
||||
router.getAsync('/settings', passport.loggedIn, async (req, res) => {
|
||||
const configItems = await settings.get(req.context);
|
||||
configItems.hash = settings.hash(configItems);
|
||||
return res.json(configItems);
|
||||
});
|
||||
|
||||
router.putAsync('/settings', passport.loggedIn, passport.csrfProtection, async (req, res) => {
|
||||
const configItems = req.body;
|
||||
await settings.set(req.context, configItems);
|
||||
return res.json();
|
||||
});
|
||||
|
||||
|
||||
module.exports = router;
|
Loading…
Add table
Add a link
Reference in a new issue