refactor: simplify validations

This commit is contained in:
Carlos Valente
2025-06-05 20:13:14 +02:00
committed by Carlos Valente
parent 9a62daf047
commit b1d23467a2
9 changed files with 33 additions and 39 deletions
@@ -5,7 +5,7 @@ import type { Request, Response, NextFunction } from 'express';
* @description Validates object for POST /ontime/settings/welcomedialog
*/
export const validateWelcomeDialog = [
body('show').exists().isBoolean(),
body('show').isBoolean(),
(req: Request, res: Response, next: NextFunction) => {
const errors = validationResult(req);
if (!errors.isEmpty()) return res.status(422).json({ errors: errors.array() });