X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fvideos%2Fvideo-imports.ts;h=0ab9e6e6f75a44c022ac85e5ed26c2f345248c80;hb=396f6f0140b0f76162e2378fd5a61e2f888673ed;hp=3115acb21a8d6631c0d5090a77a7aa56462ca017;hpb=97eba003a9d0adcb0cab9190f566327b1417c7d3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/videos/video-imports.ts b/server/middlewares/validators/videos/video-imports.ts index 3115acb21..0ab9e6e6f 100644 --- a/server/middlewares/validators/videos/video-imports.ts +++ b/server/middlewares/validators/videos/video-imports.ts @@ -19,13 +19,13 @@ import { getCommonVideoEditAttributes } from './videos' const videoImportAddValidator = getCommonVideoEditAttributes().concat([ body('channelId') .customSanitizer(toIntOrNull) - .custom(isIdValid).withMessage('Should have correct video channel id'), + .custom(isIdValid), body('targetUrl') .optional() - .custom(isVideoImportTargetUrlValid).withMessage('Should have a valid video import target URL'), + .custom(isVideoImportTargetUrlValid), body('magnetUri') .optional() - .custom(isVideoMagnetUriValid).withMessage('Should have a valid video magnet URI'), + .custom(isVideoMagnetUriValid), body('torrentfile') .custom((value, { req }) => isVideoImportTorrentFile(req.files)) .withMessage( @@ -95,7 +95,7 @@ const videoImportAddValidator = getCommonVideoEditAttributes().concat([ const getMyVideoImportsValidator = [ query('videoChannelSyncId') .optional() - .custom(isIdValid).withMessage('Should have correct videoChannelSync id'), + .custom(isIdValid), (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking getMyVideoImportsValidator parameters', { parameters: req.params }) @@ -108,7 +108,7 @@ const getMyVideoImportsValidator = [ const videoImportDeleteValidator = [ param('id') - .custom(isIdValid).withMessage('Should have correct import id'), + .custom(isIdValid), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking videoImportDeleteValidator parameters', { parameters: req.params }) @@ -131,7 +131,7 @@ const videoImportDeleteValidator = [ const videoImportCancelValidator = [ param('id') - .custom(isIdValid).withMessage('Should have correct import id'), + .custom(isIdValid), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking videoImportCancelValidator parameters', { parameters: req.params })