Removed old code
parent
c92579b362
commit
9f1eca7b02
9
app.js
9
app.js
|
@ -275,15 +275,6 @@ app.use((req, res, next) => {
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
// update config when modified
|
|
||||||
app.use((req, res, next) => {
|
|
||||||
if(res.configDirty){
|
|
||||||
config = common.getConfig();
|
|
||||||
app.config = config;
|
|
||||||
}
|
|
||||||
next();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Ran on all routes
|
// Ran on all routes
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
res.setHeader('Cache-Control', 'no-cache, no-store');
|
res.setHeader('Cache-Control', 'no-cache, no-store');
|
||||||
|
|
|
@ -172,8 +172,8 @@ router.post('/admin/createApiKey', restrict, checkAccess, async (req, res) => {
|
||||||
router.post('/admin/settings/update', restrict, checkAccess, (req, res) => {
|
router.post('/admin/settings/update', restrict, checkAccess, (req, res) => {
|
||||||
const result = common.updateConfig(req.body);
|
const result = common.updateConfig(req.body);
|
||||||
if(result === true){
|
if(result === true){
|
||||||
|
req.app.config = common.getConfig();
|
||||||
res.status(200).json({ message: 'Settings successfully updated' });
|
res.status(200).json({ message: 'Settings successfully updated' });
|
||||||
res.configDirty = true;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
res.status(400).json({ message: 'Permission denied' });
|
res.status(400).json({ message: 'Permission denied' });
|
||||||
|
|
Loading…
Reference in New Issue