aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos/video-channels.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-23 10:40:39 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit3e753302d8c911b59971c16a8018df0e1ab78465 (patch)
treeefce7ece3273589228c5c948ea6757b2bdf65429 /server/middlewares/validators/videos/video-channels.ts
parenta8b666e9f1ed002230869606308749614390c82f (diff)
downloadPeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.tar.gz
PeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.tar.zst
PeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.zip
Refactor middleware helpers
Diffstat (limited to 'server/middlewares/validators/videos/video-channels.ts')
-rw-r--r--server/middlewares/validators/videos/video-channels.ts3
1 files changed, 1 insertions, 2 deletions
diff --git a/server/middlewares/validators/videos/video-channels.ts b/server/middlewares/validators/videos/video-channels.ts
index f5a59cacb..c1065b898 100644
--- a/server/middlewares/validators/videos/video-channels.ts
+++ b/server/middlewares/validators/videos/video-channels.ts
@@ -2,8 +2,6 @@ import * as express from 'express'
2import { body, param } from 'express-validator/check' 2import { body, param } from 'express-validator/check'
3import { UserRight } from '../../../../shared' 3import { UserRight } from '../../../../shared'
4import { 4import {
5 doesLocalVideoChannelNameExist,
6 doesVideoChannelNameWithHostExist,
7 isVideoChannelDescriptionValid, 5 isVideoChannelDescriptionValid,
8 isVideoChannelNameValid, 6 isVideoChannelNameValid,
9 isVideoChannelSupportValid 7 isVideoChannelSupportValid
@@ -15,6 +13,7 @@ import { areValidationErrors } from '../utils'
15import { isActorPreferredUsernameValid } from '../../../helpers/custom-validators/activitypub/actor' 13import { isActorPreferredUsernameValid } from '../../../helpers/custom-validators/activitypub/actor'
16import { ActorModel } from '../../../models/activitypub/actor' 14import { ActorModel } from '../../../models/activitypub/actor'
17import { isBooleanValid } from '../../../helpers/custom-validators/misc' 15import { isBooleanValid } from '../../../helpers/custom-validators/misc'
16import { doesLocalVideoChannelNameExist, doesVideoChannelNameWithHostExist } from '../../../helpers/middlewares'
18 17
19const videoChannelsAddValidator = [ 18const videoChannelsAddValidator = [
20 body('name').custom(isActorPreferredUsernameValid).withMessage('Should have a valid channel name'), 19 body('name').custom(isActorPreferredUsernameValid).withMessage('Should have a valid channel name'),