rounte für /config "Einstellungen" hinterlegt

This commit is contained in:
Robert Richter 2019-05-05 00:02:55 +02:00
parent ce701dd809
commit 48b9d93480

View File

@ -47,6 +47,22 @@ module.exports = function(app, sql, app_cfg, passport, auth) {
}); });
}); });
// get /config
app.get('/config', auth.ensureAuthenticated, function(req, res) {
sql.db_get_userconfig(req.user.id, function(data) {
res.render('config', {
title: 'Einstellungen',
user: req.user,
reset_counter: data
});
});
});
app.post('/config', auth.ensureAuthenticated, function(req, res) {
sql.db_set_userconfig(req.user.id, req.body.set_reset_counter, function(data) {
res.redirect('/config');
});
});
// get /ueber // get /ueber
app.get('/ueber', function(req, res) { app.get('/ueber', function(req, res) {