diff options
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/video-channels.ts | 17 |
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 @@ | |||
1 | import * as express from 'express' | ||
2 | import 'express-validator' | 1 | import 'express-validator' |
3 | import 'multer' | 2 | import 'multer' |
4 | import * as validator from 'validator' | 3 | import * as validator from 'validator' |
5 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' | 4 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' |
6 | import { VideoChannelModel } from '../../models/video/video-channel' | ||
7 | import { exists } from './misc' | 5 | import { exists } from './misc' |
8 | 6 | ||
9 | const VIDEO_CHANNELS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_CHANNELS | 7 | const VIDEO_CHANNELS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_CHANNELS |
@@ -25,18 +23,5 @@ function isVideoChannelSupportValid (value: string) { | |||
25 | export { | 23 | export { |
26 | isVideoChannelDescriptionValid, | 24 | isVideoChannelDescriptionValid, |
27 | isVideoChannelNameValid, | 25 | isVideoChannelNameValid, |
28 | isVideoChannelSupportValid, | 26 | isVideoChannelSupportValid |
29 | } | ||
30 | |||
31 | function 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 | } |