diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-23 12:04:15 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 5b77537ce54832f47931ba47dc513be2a9197f92 (patch) | |
tree | 4f968168f1346faa82ac6c9663778e1cca65b02a /server/helpers/custom-validators | |
parent | d8e9a42c4b048b2669ab6a61704682ce23fbcf99 (diff) | |
download | PeerTube-5b77537ce54832f47931ba47dc513be2a9197f92.tar.gz PeerTube-5b77537ce54832f47931ba47dc513be2a9197f92.tar.zst PeerTube-5b77537ce54832f47931ba47dc513be2a9197f92.zip |
Correctly notify on auto blacklist
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 | } |