diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-16 09:28:18 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-16 09:42:56 +0200 |
commit | 2efd32f697549c59337db5177a93749af8e605d8 (patch) | |
tree | 42adaa4bb67b6aa48dcd4fb660616fb37b611573 /server/helpers/custom-validators/videos.ts | |
parent | 17c49e60b367868c80f44b9921793dc3a2d9adaa (diff) | |
download | PeerTube-2efd32f697549c59337db5177a93749af8e605d8.tar.gz PeerTube-2efd32f697549c59337db5177a93749af8e605d8.tar.zst PeerTube-2efd32f697549c59337db5177a93749af8e605d8.zip |
Fix updating video tags to empty field
Diffstat (limited to 'server/helpers/custom-validators/videos.ts')
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index c35db49ac..002324fe0 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts | |||
@@ -57,9 +57,11 @@ function isVideoTagValid (tag: string) { | |||
57 | } | 57 | } |
58 | 58 | ||
59 | function isVideoTagsValid (tags: string[]) { | 59 | function isVideoTagsValid (tags: string[]) { |
60 | return isArray(tags) && | 60 | return tags === null || ( |
61 | validator.isInt(tags.length.toString(), VIDEOS_CONSTRAINTS_FIELDS.TAGS) && | 61 | isArray(tags) && |
62 | tags.every(tag => isVideoTagValid(tag)) | 62 | validator.isInt(tags.length.toString(), VIDEOS_CONSTRAINTS_FIELDS.TAGS) && |
63 | tags.every(tag => isVideoTagValid(tag)) | ||
64 | ) | ||
63 | } | 65 | } |
64 | 66 | ||
65 | function isVideoAbuseReasonValid (value: string) { | 67 | function isVideoAbuseReasonValid (value: string) { |