1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 22:39:26 +00:00

Reorder User constructor params

This commit is contained in:
2022-04-07 13:38:41 +00:00
parent 95b1636288
commit ad1a50d4f2
9 changed files with 16 additions and 17 deletions

View File

@@ -13,7 +13,7 @@ router.get('/', (req, res) => {
});
router.get('/dashboard', async (req, res) => {
const u = await new User(req.db, null, req.session.userId);
const u = await new User(req.db, req.session.userId);
const recentTests = await u.getTests({ range: 'before' });
const upcomingTests = await u.getTests({ range: 'after' });
@@ -52,7 +52,7 @@ router.get('/dashboard', async (req, res) => {
router.all(/user\/(.{36})(\/.*)?/, async (req, res, next) => {
let u;
try {
u = await new User(req.db, null, req.params[0]);
u = await new User(req.db, req.params[0]);
} catch (e) {
return res.status(400).render('error', {
title: 'Stratos - Error',
@@ -65,7 +65,6 @@ router.all(/user\/(.{36})(\/.*)?/, async (req, res, next) => {
if (!await u.hasAccess(await new User(
req.db,
null,
req.session.userId
)))
return res.redirect('/admin/dashboard');