beautifyed
This commit is contained in:
parent
ef495986a7
commit
264dcebf6c
10
app.js
10
app.js
|
@ -312,7 +312,9 @@ app.post('/userrights', requireAuth, requireAdmin, async (req, res) => {
|
|||
const message = 'Error sending Mail:' + error;
|
||||
res.render('error', { session: req.session, message });
|
||||
}
|
||||
})}}
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if (type === 'admin') {
|
||||
await pool.query('UPDATE users SET role = $1 WHERE id = $2', ['admin', userId]);
|
||||
}
|
||||
|
@ -831,14 +833,16 @@ try {
|
|||
const resultAnw = await pool.query('Select * FROM anwesend WHERE fid_teilnehmer = $1 AND fid_training = $2', [teilnehmer, trainingId]);
|
||||
if (resultAnw.rows.length == 0) {
|
||||
await pool.query('INSERT INTO anwesend (fid_teilnehmer, fid_training) VALUES ($1, $2)', [teilnehmer, trainingId]);
|
||||
}}
|
||||
}
|
||||
}
|
||||
req.session.activeRiege = riege;
|
||||
res.redirect('/training');
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
req.session.message = ['Error', error, 'error'];
|
||||
res.redirect('/training');
|
||||
}})
|
||||
}
|
||||
})
|
||||
|
||||
const server = app.listen(port, '0.0.0.0', () => {
|
||||
log.Info(`Server is running on ${process.env.HOST}:${port}/`);
|
||||
|
|
Loading…
Reference in New Issue