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.ts17
1 files changed, 1 insertions, 16 deletions
diff --git a/server/helpers/custom-validators/video-channels.ts b/server/helpers/custom-validators/video-channels.ts
index 0471f6ec4..f55f0c8ef 100644
--- a/server/helpers/custom-validators/video-channels.ts
+++ b/server/helpers/custom-validators/video-channels.ts
@@ -1,9 +1,7 @@
1import * as express from 'express'
2import 'express-validator' 1import 'express-validator'
3import 'multer' 2import 'multer'
4import * as validator from 'validator' 3import * as validator from 'validator'
5import { CONSTRAINTS_FIELDS } from '../../initializers/constants' 4import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
6import { VideoChannelModel } from '../../models/video/video-channel'
7import { exists } from './misc' 5import { exists } from './misc'
8 6
9const VIDEO_CHANNELS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_CHANNELS 7const VIDEO_CHANNELS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_CHANNELS
@@ -25,18 +23,5 @@ function isVideoChannelSupportValid (value: string) {
25export { 23export {
26 isVideoChannelDescriptionValid, 24 isVideoChannelDescriptionValid,
27 isVideoChannelNameValid, 25 isVideoChannelNameValid,
28 isVideoChannelSupportValid, 26 isVideoChannelSupportValid
29}
30
31function processVideoChannelExist (videoChannel: VideoChannelModel, res: express.Response) {
32 if (!videoChannel) {
33 res.status(404)
34 .json({ error: 'Video channel not found' })
35 .end()
36
37 return false
38 }
39
40 res.locals.videoChannel = videoChannel
41 return true
42} 27}