diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:27:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:27:04 +0200 |
commit | 396f6f0140b0f76162e2378fd5a61e2f888673ed (patch) | |
tree | a5bd668bfc7dca7f311b9fc42ebb8bd01f462648 /server/middlewares/validators/videos/video-imports.ts | |
parent | 97eba003a9d0adcb0cab9190f566327b1417c7d3 (diff) | |
download | PeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.tar.gz PeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.tar.zst PeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.zip |
Cleanup useless express validator messages
Diffstat (limited to 'server/middlewares/validators/videos/video-imports.ts')
-rw-r--r-- | server/middlewares/validators/videos/video-imports.ts | 12 |
1 files changed, 6 insertions, 6 deletions
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' | |||
19 | const videoImportAddValidator = getCommonVideoEditAttributes().concat([ | 19 | const videoImportAddValidator = getCommonVideoEditAttributes().concat([ |
20 | body('channelId') | 20 | body('channelId') |
21 | .customSanitizer(toIntOrNull) | 21 | .customSanitizer(toIntOrNull) |
22 | .custom(isIdValid).withMessage('Should have correct video channel id'), | 22 | .custom(isIdValid), |
23 | body('targetUrl') | 23 | body('targetUrl') |
24 | .optional() | 24 | .optional() |
25 | .custom(isVideoImportTargetUrlValid).withMessage('Should have a valid video import target URL'), | 25 | .custom(isVideoImportTargetUrlValid), |
26 | body('magnetUri') | 26 | body('magnetUri') |
27 | .optional() | 27 | .optional() |
28 | .custom(isVideoMagnetUriValid).withMessage('Should have a valid video magnet URI'), | 28 | .custom(isVideoMagnetUriValid), |
29 | body('torrentfile') | 29 | body('torrentfile') |
30 | .custom((value, { req }) => isVideoImportTorrentFile(req.files)) | 30 | .custom((value, { req }) => isVideoImportTorrentFile(req.files)) |
31 | .withMessage( | 31 | .withMessage( |
@@ -95,7 +95,7 @@ const videoImportAddValidator = getCommonVideoEditAttributes().concat([ | |||
95 | const getMyVideoImportsValidator = [ | 95 | const getMyVideoImportsValidator = [ |
96 | query('videoChannelSyncId') | 96 | query('videoChannelSyncId') |
97 | .optional() | 97 | .optional() |
98 | .custom(isIdValid).withMessage('Should have correct videoChannelSync id'), | 98 | .custom(isIdValid), |
99 | 99 | ||
100 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 100 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
101 | logger.debug('Checking getMyVideoImportsValidator parameters', { parameters: req.params }) | 101 | logger.debug('Checking getMyVideoImportsValidator parameters', { parameters: req.params }) |
@@ -108,7 +108,7 @@ const getMyVideoImportsValidator = [ | |||
108 | 108 | ||
109 | const videoImportDeleteValidator = [ | 109 | const videoImportDeleteValidator = [ |
110 | param('id') | 110 | param('id') |
111 | .custom(isIdValid).withMessage('Should have correct import id'), | 111 | .custom(isIdValid), |
112 | 112 | ||
113 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 113 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
114 | logger.debug('Checking videoImportDeleteValidator parameters', { parameters: req.params }) | 114 | logger.debug('Checking videoImportDeleteValidator parameters', { parameters: req.params }) |
@@ -131,7 +131,7 @@ const videoImportDeleteValidator = [ | |||
131 | 131 | ||
132 | const videoImportCancelValidator = [ | 132 | const videoImportCancelValidator = [ |
133 | param('id') | 133 | param('id') |
134 | .custom(isIdValid).withMessage('Should have correct import id'), | 134 | .custom(isIdValid), |
135 | 135 | ||
136 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 136 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
137 | logger.debug('Checking videoImportCancelValidator parameters', { parameters: req.params }) | 137 | logger.debug('Checking videoImportCancelValidator parameters', { parameters: req.params }) |