From 396f6f0140b0f76162e2378fd5a61e2f888673ed Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 17 Aug 2022 14:27:04 +0200 Subject: Cleanup useless express validator messages --- server/middlewares/validators/redundancy.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'server/middlewares/validators/redundancy.ts') diff --git a/server/middlewares/validators/redundancy.ts b/server/middlewares/validators/redundancy.ts index d31b216f5..a74772bd1 100644 --- a/server/middlewares/validators/redundancy.ts +++ b/server/middlewares/validators/redundancy.ts @@ -22,11 +22,11 @@ const videoFileRedundancyGetValidator = [ param('resolution') .customSanitizer(toIntOrNull) - .custom(exists).withMessage('Should have a valid resolution'), + .custom(exists), param('fps') .optional() .customSanitizer(toIntOrNull) - .custom(exists).withMessage('Should have a valid fps'), + .custom(exists), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking videoFileRedundancyGetValidator parameters', { parameters: req.params }) @@ -69,7 +69,7 @@ const videoPlaylistRedundancyGetValidator = [ param('streamingPlaylistType') .customSanitizer(toIntOrNull) - .custom(exists).withMessage('Should have a valid streaming playlist type'), + .custom(exists), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking videoPlaylistRedundancyGetValidator parameters', { parameters: req.params }) @@ -104,10 +104,12 @@ const videoPlaylistRedundancyGetValidator = [ ] const updateServerRedundancyValidator = [ - param('host').custom(isHostValid).withMessage('Should have a valid host'), + param('host') + .custom(isHostValid), + body('redundancyAllowed') .customSanitizer(toBooleanOrNull) - .custom(isBooleanValid).withMessage('Should have a valid redundancyAllowed attribute'), + .custom(isBooleanValid).withMessage('Should have a valid redundancyAllowed boolean'), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking updateServerRedundancy parameters', { parameters: req.params }) @@ -130,7 +132,7 @@ const updateServerRedundancyValidator = [ const listVideoRedundanciesValidator = [ query('target') - .custom(isVideoRedundancyTarget).withMessage('Should have a valid video redundancies target'), + .custom(isVideoRedundancyTarget), (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking listVideoRedundanciesValidator parameters', { parameters: req.query }) @@ -144,8 +146,7 @@ const listVideoRedundanciesValidator = [ const addVideoRedundancyValidator = [ body('videoId') .customSanitizer(toCompleteUUID) - .custom(isIdOrUUIDValid) - .withMessage('Should have a valid video id'), + .custom(isIdOrUUIDValid), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking addVideoRedundancyValidator parameters', { parameters: req.query }) @@ -176,8 +177,7 @@ const addVideoRedundancyValidator = [ const removeVideoRedundancyValidator = [ param('redundancyId') - .custom(isIdValid) - .withMessage('Should have a valid redundancy id'), + .custom(isIdValid), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking removeVideoRedundancyValidator parameters', { parameters: req.query }) -- cgit v1.2.3