aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/video-channels.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-23 12:04:15 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit5b77537ce54832f47931ba47dc513be2a9197f92 (patch)
tree4f968168f1346faa82ac6c9663778e1cca65b02a /server/helpers/custom-validators/video-channels.ts
parentd8e9a42c4b048b2669ab6a61704682ce23fbcf99 (diff)
downloadPeerTube-5b77537ce54832f47931ba47dc513be2a9197f92.tar.gz
PeerTube-5b77537ce54832f47931ba47dc513be2a9197f92.tar.zst
PeerTube-5b77537ce54832f47931ba47dc513be2a9197f92.zip
Correctly notify on auto blacklist
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}