X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fvideos%2Fvideos.ts;h=159727e2856d11dea05aa172e414ac27ae30f56e;hb=b718fd22374d64534bcfe69932cf562894abed6a;hp=194d12c6e5668d242f5fcd781ff9cf810356d0c4;hpb=adb115f5522bea4d52456a9fc5eb4140bb064476;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 194d12c6e..159727e28 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts @@ -341,11 +341,14 @@ function getCommonVideoAttributes () { .optional() .toBoolean() .custom(isBooleanValid).withMessage('Should have comments enabled boolean'), - body('originallyPublishedAt') + body('downloadEnabled') .optional() - .customSanitizer(toValueOrNull) - .custom(isVideoOriginallyPublishedAtValid).withMessage('Should have a valid original publication date'), - + .toBoolean() + .custom(isBooleanValid).withMessage('Should have downloading enabled boolean'), + body('originallyPublishedAt') + .optional() + .customSanitizer(toValueOrNull) + .custom(isVideoOriginallyPublishedAtValid).withMessage('Should have a valid original publication date'), body('scheduleUpdate') .optional() .customSanitizer(toValueOrNull),