diff options
Diffstat (limited to 'server/middlewares/validators/videos/video-imports.ts')
-rw-r--r-- | server/middlewares/validators/videos/video-imports.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/validators/videos/video-imports.ts b/server/middlewares/validators/videos/video-imports.ts index 8b0dd8960..318dad100 100644 --- a/server/middlewares/validators/videos/video-imports.ts +++ b/server/middlewares/validators/videos/video-imports.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { body } from 'express-validator/check' | 2 | import { body } from 'express-validator' |
3 | import { isIdValid } from '../../../helpers/custom-validators/misc' | 3 | import { isIdValid, toIntOrNull } 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 { getCommonVideoEditAttributes } from './videos' | 6 | import { getCommonVideoEditAttributes } from './videos' |
@@ -13,7 +13,7 @@ import { doesVideoChannelOfAccountExist } from '../../../helpers/middlewares' | |||
13 | 13 | ||
14 | const videoImportAddValidator = getCommonVideoEditAttributes().concat([ | 14 | const videoImportAddValidator = getCommonVideoEditAttributes().concat([ |
15 | body('channelId') | 15 | body('channelId') |
16 | .toInt() | 16 | .customSanitizer(toIntOrNull) |
17 | .custom(isIdValid).withMessage('Should have correct video channel id'), | 17 | .custom(isIdValid).withMessage('Should have correct video channel id'), |
18 | body('targetUrl') | 18 | body('targetUrl') |
19 | .optional() | 19 | .optional() |