mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 02:13:48 +00:00
refactor: initialise data
This commit is contained in:
committed by
Carlos Valente
parent
dae32e89a3
commit
84792bc00d
@@ -5,11 +5,12 @@ import { Request, Response, NextFunction } from 'express';
|
||||
* @description Validates object for POST /ontime/views
|
||||
*/
|
||||
export const validateViewSettings = [
|
||||
check('overrideStyles').isBoolean().withMessage('overrideStyles value must be boolean'),
|
||||
check('endMessage').isString().trim().withMessage('endMessage value must be string'),
|
||||
check('normalColor').isString().trim().withMessage('normalColor value must be string'),
|
||||
check('warningColor').isString().trim().withMessage('warningColor value must be string'),
|
||||
check('dangerColor').isString().trim().withMessage('dangerColor value must be string'),
|
||||
check('dangerColor').exists().isString().trim().withMessage('dangerColor value must be string'),
|
||||
check('endMessage').exists().isString().trim().withMessage('endMessage value must be string'),
|
||||
check('freezeEnd').exists().isBoolean().withMessage('freezeEnd value must be boolean'),
|
||||
check('normalColor').exists().isString().trim().withMessage('normalColor value must be string'),
|
||||
check('overrideStyles').exists().isBoolean().withMessage('overrideStyles value must be boolean'),
|
||||
check('warningColor').exists().isString().trim().withMessage('warningColor value must be string'),
|
||||
|
||||
(req: Request, res: Response, next: NextFunction) => {
|
||||
const errors = validationResult(req);
|
||||
|
||||
Reference in New Issue
Block a user