mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 09:23:51 +00:00
refactor: simplify validations
This commit is contained in:
@@ -2,10 +2,10 @@ import type { Request, Response, NextFunction } from 'express';
|
||||
import { body, validationResult } from 'express-validator';
|
||||
|
||||
export const validateGenerateUrl = [
|
||||
body('baseUrl').exists().isString().notEmpty().trim(),
|
||||
body('path').exists().isString().trim(),
|
||||
body('lock').exists().isBoolean(),
|
||||
body('authenticate').exists().isBoolean(),
|
||||
body('baseUrl').isString().trim().notEmpty(),
|
||||
body('path').isString().trim().notEmpty(),
|
||||
body('lock').isBoolean(),
|
||||
body('authenticate').isBoolean(),
|
||||
|
||||
(req: Request, res: Response, next: NextFunction) => {
|
||||
const errors = validationResult(req);
|
||||
|
||||
Reference in New Issue
Block a user