aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos/video-imports.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/videos/video-imports.ts')
-rw-r--r--server/middlewares/validators/videos/video-imports.ts6
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 @@
1import * as express from 'express' 1import * as express from 'express'
2import { body } from 'express-validator/check' 2import { body } from 'express-validator'
3import { isIdValid } from '../../../helpers/custom-validators/misc' 3import { isIdValid, toIntOrNull } from '../../../helpers/custom-validators/misc'
4import { logger } from '../../../helpers/logger' 4import { logger } from '../../../helpers/logger'
5import { areValidationErrors } from '../utils' 5import { areValidationErrors } from '../utils'
6import { getCommonVideoEditAttributes } from './videos' 6import { getCommonVideoEditAttributes } from './videos'
@@ -13,7 +13,7 @@ import { doesVideoChannelOfAccountExist } from '../../../helpers/middlewares'
13 13
14const videoImportAddValidator = getCommonVideoEditAttributes().concat([ 14const 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()