diff options
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 26a671a1e..be05b2a69 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -62,6 +62,7 @@ const videosAddValidator = getCommonVideoEditAttributes().concat([ | |||
62 | .custom((value, { req }) => isFileFieldValid(req.files, 'videofile')) | 62 | .custom((value, { req }) => isFileFieldValid(req.files, 'videofile')) |
63 | .withMessage('Should have a file'), | 63 | .withMessage('Should have a file'), |
64 | body('name') | 64 | body('name') |
65 | .trim() | ||
65 | .custom(isVideoNameValid) | 66 | .custom(isVideoNameValid) |
66 | .withMessage('Should have a valid name'), | 67 | .withMessage('Should have a valid name'), |
67 | body('channelId') | 68 | body('channelId') |
@@ -129,6 +130,7 @@ const videosUpdateValidator = getCommonVideoEditAttributes().concat([ | |||
129 | param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), | 130 | param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), |
130 | body('name') | 131 | body('name') |
131 | .optional() | 132 | .optional() |
133 | .trim() | ||
132 | .custom(isVideoNameValid).withMessage('Should have a valid name'), | 134 | .custom(isVideoNameValid).withMessage('Should have a valid name'), |
133 | body('channelId') | 135 | body('channelId') |
134 | .optional() | 136 | .optional() |