fix: #9819, show same time info for ban

This commit is contained in:
Barış Soner Uşaklı
2021-09-21 17:04:17 -04:00
parent 7a2f0ae15b
commit 9f0e55ad3e
3 changed files with 26 additions and 19 deletions

View File

@@ -21,7 +21,10 @@ const url = nconf.get('url');
helpers.noScriptErrors = async function (req, res, error, httpStatus) {
if (req.body.noscript !== 'true') {
return res.status(httpStatus).send(error);
if (typeof error === 'string') {
return res.status(httpStatus).send(error);
}
return res.status(httpStatus).json(error);
}
const middleware = require('../middleware');
const httpStatusString = httpStatus.toString();