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/follows.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/middlewares/validators/follows.ts') diff --git a/server/middlewares/validators/follows.ts b/server/middlewares/validators/follows.ts index 023dba5b5..639c60c03 100644 --- a/server/middlewares/validators/follows.ts +++ b/server/middlewares/validators/follows.ts @@ -19,10 +19,10 @@ import { areValidationErrors } from './shared' const listFollowsValidator = [ query('state') .optional() - .custom(isFollowStateValid).withMessage('Should have a valid follow state'), + .custom(isFollowStateValid), query('actorType') .optional() - .custom(isActorTypeValid).withMessage('Should have a valid actor type'), + .custom(isActorTypeValid), (req: express.Request, res: express.Response, next: express.NextFunction) => { if (areValidationErrors(req, res)) return @@ -70,8 +70,7 @@ const followValidator = [ const removeFollowingValidator = [ param('hostOrHandle') - .custom(value => isHostValid(value) || isRemoteHandleValid(value)) - .withMessage('Should have a valid host/handle'), + .custom(value => isHostValid(value) || isRemoteHandleValid(value)), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking unfollowing parameters', { parameters: req.params }) @@ -100,7 +99,8 @@ const removeFollowingValidator = [ ] const getFollowerValidator = [ - param('nameWithHost').custom(isValidActorHandle).withMessage('Should have a valid nameWithHost'), + param('nameWithHost') + .custom(isValidActorHandle), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking get follower parameters', { parameters: req.params }) -- cgit v1.2.3