Improve redirect for failure editing accounts
parent
6c174f3e02
commit
7132273e9e
|
@ -214,7 +214,9 @@ router.post('/account', checkLoginStatus.user, async function(req, res, next) {
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.error("ERROR: " + err.message);
|
console.error("ERROR: " + err.message);
|
||||||
req.flash("error", "An error has occurred.");
|
req.flash("error", "An error has occurred.");
|
||||||
res.redirect('/manage/account');
|
let URL = '/manage/account';
|
||||||
|
if(loggedInAccountIsAdmin && accountID) URL += `?account=${accountID}`;
|
||||||
|
res.redirect(URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Reference in New Issue