diff options
Diffstat (limited to 'server/middlewares/validators/videos.ts')
-rw-r--r-- | server/middlewares/validators/videos.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/middlewares/validators/videos.ts b/server/middlewares/validators/videos.ts index da17b4a68..5595edf17 100644 --- a/server/middlewares/validators/videos.ts +++ b/server/middlewares/validators/videos.ts | |||
@@ -94,6 +94,9 @@ const videosAddValidator = [ | |||
94 | body('channelId') | 94 | body('channelId') |
95 | .toInt() | 95 | .toInt() |
96 | .custom(isIdValid).withMessage('Should have correct video channel id'), | 96 | .custom(isIdValid).withMessage('Should have correct video channel id'), |
97 | body('scheduleUpdate') | ||
98 | .optional() | ||
99 | .customSanitizer(toValueOrNull), | ||
97 | body('scheduleUpdate.updateAt') | 100 | body('scheduleUpdate.updateAt') |
98 | .optional() | 101 | .optional() |
99 | .custom(isDateValid).withMessage('Should have a valid schedule update date'), | 102 | .custom(isDateValid).withMessage('Should have a valid schedule update date'), |
@@ -199,6 +202,9 @@ const videosUpdateValidator = [ | |||
199 | .optional() | 202 | .optional() |
200 | .toInt() | 203 | .toInt() |
201 | .custom(isIdValid).withMessage('Should have correct video channel id'), | 204 | .custom(isIdValid).withMessage('Should have correct video channel id'), |
205 | body('scheduleUpdate') | ||
206 | .optional() | ||
207 | .customSanitizer(toValueOrNull), | ||
202 | body('scheduleUpdate.updateAt') | 208 | body('scheduleUpdate.updateAt') |
203 | .optional() | 209 | .optional() |
204 | .custom(isDateValid).withMessage('Should have a valid schedule update date'), | 210 | .custom(isDateValid).withMessage('Should have a valid schedule update date'), |