X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Ffollows.ts;h=639c60c0308ea955623c80ac099186db1b4dc32f;hb=396f6f0140b0f76162e2378fd5a61e2f888673ed;hp=023dba5b53963c7efc17400f1a1000ed8b5ce738;hpb=97eba003a9d0adcb0cab9190f566327b1417c7d3;p=github%2FChocobozzz%2FPeerTube.git 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 })