Removed old code

master
Mark Moffat 2019-11-01 23:00:40 +10:30
parent c92579b362
commit 9f1eca7b02
2 changed files with 1 additions and 10 deletions

9
app.js
View File

@ -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');

View File

@ -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' });