aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos/video-channels.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-26 10:55:40 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-03-18 11:17:59 +0100
commit418d092afa81e2c8fe8ac6838fc4b5eb0af6a782 (patch)
tree5e9bc5604fd5d66a006cfebb7acdbdd5486e5d1e /server/middlewares/validators/videos/video-channels.ts
parentb427febb4d5cebf03b815bca2c59af6e82491569 (diff)
downloadPeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.tar.gz
PeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.tar.zst
PeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.zip
Playlist server API
Diffstat (limited to 'server/middlewares/validators/videos/video-channels.ts')
-rw-r--r--server/middlewares/validators/videos/video-channels.ts14
1 files changed, 0 insertions, 14 deletions
diff --git a/server/middlewares/validators/videos/video-channels.ts b/server/middlewares/validators/videos/video-channels.ts
index f039794e0..c2763ce51 100644
--- a/server/middlewares/validators/videos/video-channels.ts
+++ b/server/middlewares/validators/videos/video-channels.ts
@@ -16,19 +16,6 @@ import { areValidationErrors } from '../utils'
16import { isActorPreferredUsernameValid } from '../../../helpers/custom-validators/activitypub/actor' 16import { isActorPreferredUsernameValid } from '../../../helpers/custom-validators/activitypub/actor'
17import { ActorModel } from '../../../models/activitypub/actor' 17import { ActorModel } from '../../../models/activitypub/actor'
18 18
19const listVideoAccountChannelsValidator = [
20 param('accountName').exists().withMessage('Should have a valid account name'),
21
22 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
23 logger.debug('Checking listVideoAccountChannelsValidator parameters', { parameters: req.body })
24
25 if (areValidationErrors(req, res)) return
26 if (!await isAccountNameWithHostExist(req.params.accountName, res)) return
27
28 return next()
29 }
30]
31
32const videoChannelsAddValidator = [ 19const videoChannelsAddValidator = [
33 body('name').custom(isActorPreferredUsernameValid).withMessage('Should have a valid channel name'), 20 body('name').custom(isActorPreferredUsernameValid).withMessage('Should have a valid channel name'),
34 body('displayName').custom(isVideoChannelNameValid).withMessage('Should have a valid display name'), 21 body('displayName').custom(isVideoChannelNameValid).withMessage('Should have a valid display name'),
@@ -127,7 +114,6 @@ const localVideoChannelValidator = [
127// --------------------------------------------------------------------------- 114// ---------------------------------------------------------------------------
128 115
129export { 116export {
130 listVideoAccountChannelsValidator,
131 videoChannelsAddValidator, 117 videoChannelsAddValidator,
132 videoChannelsUpdateValidator, 118 videoChannelsUpdateValidator,
133 videoChannelsRemoveValidator, 119 videoChannelsRemoveValidator,