Show full validation error

This commit is contained in:
Maidul Islam
2023-01-01 13:13:03 -05:00
parent 776b4c2922
commit f2bd4aec39

View File

@@ -15,7 +15,7 @@ const validate = (req: Request, res: Response, next: NextFunction) => {
try {
const errors = validationResult(req);
if (!errors.isEmpty()) {
return next(ValidationError({ context: { errors: `One or more of your paramters are invalid [error=${errors.array}]` } }))
return next(ValidationError({ context: { errors: `One or more of your parameters are invalid [error(s)=${(JSON.stringify(errors))}]` } }))
}
return next();