aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/video-channels.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators/video-channels.ts')
-rw-r--r--server/helpers/custom-validators/video-channels.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/video-channels.ts b/server/helpers/custom-validators/video-channels.ts
index 6bc96bf51..2a6f56840 100644
--- a/server/helpers/custom-validators/video-channels.ts
+++ b/server/helpers/custom-validators/video-channels.ts
@@ -16,6 +16,10 @@ function isVideoChannelNameValid (value: string) {
16 return exists(value) && validator.isLength(value, VIDEO_CHANNELS_CONSTRAINTS_FIELDS.NAME) 16 return exists(value) && validator.isLength(value, VIDEO_CHANNELS_CONSTRAINTS_FIELDS.NAME)
17} 17}
18 18
19function isVideoChannelSupportValid (value: string) {
20 return value === null || (exists(value) && validator.isLength(value, VIDEO_CHANNELS_CONSTRAINTS_FIELDS.SUPPORT))
21}
22
19async function isVideoChannelExist (id: string, res: express.Response) { 23async function isVideoChannelExist (id: string, res: express.Response) {
20 let videoChannel: VideoChannelModel 24 let videoChannel: VideoChannelModel
21 if (validator.isInt(id)) { 25 if (validator.isInt(id)) {
@@ -41,5 +45,6 @@ async function isVideoChannelExist (id: string, res: express.Response) {
41export { 45export {
42 isVideoChannelDescriptionValid, 46 isVideoChannelDescriptionValid,
43 isVideoChannelNameValid, 47 isVideoChannelNameValid,
48 isVideoChannelSupportValid,
44 isVideoChannelExist 49 isVideoChannelExist
45} 50}