diff options
author | clementbrizard <clementbrizard53@gmail.com> | 2019-01-12 13:45:23 +0000 |
---|---|---|
committer | clementbrizard <clementbrizard53@gmail.com> | 2019-01-12 13:45:23 +0000 |
commit | 1e74f19a2179df7fc2e0da73163ef2c3118cbecb (patch) | |
tree | d00a7b500e5ffe4973f4ce4a52b85da28733ae28 /server/middlewares | |
parent | c80341655fce5e70ad6da7d812e2ddeb1f8ef7f2 (diff) | |
download | PeerTube-1e74f19a2179df7fc2e0da73163ef2c3118cbecb.tar.gz PeerTube-1e74f19a2179df7fc2e0da73163ef2c3118cbecb.tar.zst PeerTube-1e74f19a2179df7fc2e0da73163ef2c3118cbecb.zip |
Enable video upload and edit
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 051a19e16..194d12c6e 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -14,6 +14,7 @@ import { | |||
14 | } from '../../../helpers/custom-validators/misc' | 14 | } from '../../../helpers/custom-validators/misc' |
15 | import { | 15 | import { |
16 | checkUserCanManageVideo, | 16 | checkUserCanManageVideo, |
17 | isVideoOriginallyPublishedAtValid, | ||
17 | isScheduleVideoUpdatePrivacyValid, | 18 | isScheduleVideoUpdatePrivacyValid, |
18 | isVideoCategoryValid, | 19 | isVideoCategoryValid, |
19 | isVideoChannelOfAccountExist, | 20 | isVideoChannelOfAccountExist, |
@@ -340,6 +341,10 @@ function getCommonVideoAttributes () { | |||
340 | .optional() | 341 | .optional() |
341 | .toBoolean() | 342 | .toBoolean() |
342 | .custom(isBooleanValid).withMessage('Should have comments enabled boolean'), | 343 | .custom(isBooleanValid).withMessage('Should have comments enabled boolean'), |
344 | body('originallyPublishedAt') | ||
345 | .optional() | ||
346 | .customSanitizer(toValueOrNull) | ||
347 | .custom(isVideoOriginallyPublishedAtValid).withMessage('Should have a valid original publication date'), | ||
343 | 348 | ||
344 | body('scheduleUpdate') | 349 | body('scheduleUpdate') |
345 | .optional() | 350 | .optional() |