diff options
Diffstat (limited to 'server/middlewares/validators/videos/video-blacklist.ts')
-rw-r--r-- | server/middlewares/validators/videos/video-blacklist.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/validators/videos/video-blacklist.ts b/server/middlewares/validators/videos/video-blacklist.ts index db59427c7..3e8c5b30c 100644 --- a/server/middlewares/validators/videos/video-blacklist.ts +++ b/server/middlewares/validators/videos/video-blacklist.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { body, param, query } from 'express-validator/check' | 2 | import { body, param, query } from 'express-validator' |
3 | import { isBooleanValid, isIdOrUUIDValid } from '../../../helpers/custom-validators/misc' | 3 | import { isBooleanValid, isIdOrUUIDValid, toBooleanOrNull } from '../../../helpers/custom-validators/misc' |
4 | import { logger } from '../../../helpers/logger' | 4 | import { logger } from '../../../helpers/logger' |
5 | import { areValidationErrors } from '../utils' | 5 | import { areValidationErrors } from '../utils' |
6 | import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../../helpers/custom-validators/video-blacklist' | 6 | import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../../helpers/custom-validators/video-blacklist' |
@@ -24,7 +24,7 @@ const videosBlacklistAddValidator = [ | |||
24 | param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid videoId'), | 24 | param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid videoId'), |
25 | body('unfederate') | 25 | body('unfederate') |
26 | .optional() | 26 | .optional() |
27 | .toBoolean() | 27 | .customSanitizer(toBooleanOrNull) |
28 | .custom(isBooleanValid).withMessage('Should have a valid unfederate boolean'), | 28 | .custom(isBooleanValid).withMessage('Should have a valid unfederate boolean'), |
29 | body('reason') | 29 | body('reason') |
30 | .optional() | 30 | .optional() |