X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fvideos%2Fvideo-rates.ts;h=cbc144f69ed56cfc9161ad816341a7e5fa70e4e9;hb=feb34f6b6b991046aab6a10df747b48fa4da07a7;hp=4021cfecc8f6cddc580fdc0814d6decc690cba90;hpb=c8861d5dc0436ef4342ce517241e3591fa256a13;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/videos/video-rates.ts b/server/middlewares/validators/videos/video-rates.ts index 4021cfecc..cbc144f69 100644 --- a/server/middlewares/validators/videos/video-rates.ts +++ b/server/middlewares/validators/videos/video-rates.ts @@ -24,7 +24,7 @@ const videoUpdateRateValidator = [ } ] -const getAccountVideoRateValidator = function (rateType: VideoRateType) { +const getAccountVideoRateValidatorFactory = function (rateType: VideoRateType) { return [ param('name').custom(isAccountNameValid).withMessage('Should have a valid account name'), param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid videoId'), @@ -51,7 +51,7 @@ const getAccountVideoRateValidator = function (rateType: VideoRateType) { const videoRatingValidator = [ query('rating').optional().custom(isRatingValid).withMessage('Value must be one of "like" or "dislike"'), - async (req: express.Request, res: express.Response, next: express.NextFunction) => { + (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking rating parameter', { parameters: req.params }) if (areValidationErrors(req, res)) return @@ -64,6 +64,6 @@ const videoRatingValidator = [ export { videoUpdateRateValidator, - getAccountVideoRateValidator, + getAccountVideoRateValidatorFactory, videoRatingValidator }