From e94fc29706cd8e8fd892182d4de0a3ae80a3820f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 18 Jun 2018 10:24:53 +0200 Subject: Fix removing scheduled update --- server/middlewares/validators/videos.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'server/middlewares') 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 = [ body('channelId') .toInt() .custom(isIdValid).withMessage('Should have correct video channel id'), + body('scheduleUpdate') + .optional() + .customSanitizer(toValueOrNull), body('scheduleUpdate.updateAt') .optional() .custom(isDateValid).withMessage('Should have a valid schedule update date'), @@ -199,6 +202,9 @@ const videosUpdateValidator = [ .optional() .toInt() .custom(isIdValid).withMessage('Should have correct video channel id'), + body('scheduleUpdate') + .optional() + .customSanitizer(toValueOrNull), body('scheduleUpdate.updateAt') .optional() .custom(isDateValid).withMessage('Should have a valid schedule update date'), -- cgit v1.2.3