minors + set Favicon

This commit is contained in:
les
2020-01-15 23:51:09 +01:00
parent 474794e9ab
commit 3b04cdd485
10 changed files with 116 additions and 73 deletions

View File

@@ -100,10 +100,10 @@ const settingsController = {
}
},
getUserLocale (req, res) {
// load user locale specified in configuration
res.json(settingsController.user_locale)
},
// getUserLocale (req, res) {
// // load user locale specified in configuration
// res.json(settingsController.user_locale)
// },
async setRequest (req, res) {
const { key, value, is_secret } = req.body
@@ -111,6 +111,12 @@ const settingsController = {
if (ret) { res.sendStatus(200) } else { res.sendStatus(400) }
},
async setFavicon (req, res) {
if (!req.file) return res.status(400).send('Mmmmm sould not be here!')
await settingsController.set('favicon', path.join(req.file.destination, req.file.filename))
res.sendStatus(200)
},
getAllRequest (req, res) {
// get public settings and public configuration
const settings = {

View File

@@ -68,10 +68,10 @@ api.delete('/event/notification/:code', eventController.delNotification)
api.get('/settings', settingsController.getAllRequest)
api.post('/settings', isAdmin, settingsController.setRequest)
api.post('/settings/favicon', isAdmin, multer({ dest: 'thumb/' }).single('favicon'), settingsController.setFavicon)
// api.get('/settings/user_locale', settingsController.getUserLocale)
api.get('/settings/user_locale', settingsController.getUserLocale)
// confirm event
// confirm eventtags
api.get('/event/confirm/:event_id', isAuth, eventController.confirm)
api.get('/event/unconfirm/:event_id', isAuth, eventController.unconfirm)
@@ -83,6 +83,7 @@ api.get('/export/:type', cors, exportController.export)
// get events in this range
api.get('/event/:month/:year', cors, eventController.getAll)
api.get('/event', cors, eventController.select)
api.get('/instances', isAdmin, instanceController.getAll)
api.get('/instances/:instance_domain', isAdmin, instanceController.get)