aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos/video-channels.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/videos/video-channels.ts')
-rw-r--r--server/middlewares/validators/videos/video-channels.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/server/middlewares/validators/videos/video-channels.ts b/server/middlewares/validators/videos/video-channels.ts
index c2763ce51..e2067c4d9 100644
--- a/server/middlewares/validators/videos/video-channels.ts
+++ b/server/middlewares/validators/videos/video-channels.ts
@@ -1,12 +1,12 @@
1import * as express from 'express' 1import * 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 { isAccountNameWithHostExist } from '../../../helpers/custom-validators/accounts' 4import { doesAccountNameWithHostExist } from '../../../helpers/custom-validators/accounts'
5import { 5import {
6 isLocalVideoChannelNameExist, 6 doesLocalVideoChannelNameExist,
7 isVideoChannelDescriptionValid, 7 isVideoChannelDescriptionValid,
8 isVideoChannelNameValid, 8 isVideoChannelNameValid,
9 isVideoChannelNameWithHostExist, 9 doesVideoChannelNameWithHostExist,
10 isVideoChannelSupportValid 10 isVideoChannelSupportValid
11} from '../../../helpers/custom-validators/video-channels' 11} from '../../../helpers/custom-validators/video-channels'
12import { logger } from '../../../helpers/logger' 12import { logger } from '../../../helpers/logger'
@@ -49,7 +49,7 @@ const videoChannelsUpdateValidator = [
49 logger.debug('Checking videoChannelsUpdate parameters', { parameters: req.body }) 49 logger.debug('Checking videoChannelsUpdate parameters', { parameters: req.body })
50 50
51 if (areValidationErrors(req, res)) return 51 if (areValidationErrors(req, res)) return
52 if (!await isVideoChannelNameWithHostExist(req.params.nameWithHost, res)) return 52 if (!await doesVideoChannelNameWithHostExist(req.params.nameWithHost, res)) return
53 53
54 // We need to make additional checks 54 // We need to make additional checks
55 if (res.locals.videoChannel.Actor.isOwned() === false) { 55 if (res.locals.videoChannel.Actor.isOwned() === false) {
@@ -75,7 +75,7 @@ const videoChannelsRemoveValidator = [
75 logger.debug('Checking videoChannelsRemove parameters', { parameters: req.params }) 75 logger.debug('Checking videoChannelsRemove parameters', { parameters: req.params })
76 76
77 if (areValidationErrors(req, res)) return 77 if (areValidationErrors(req, res)) return
78 if (!await isVideoChannelNameWithHostExist(req.params.nameWithHost, res)) return 78 if (!await doesVideoChannelNameWithHostExist(req.params.nameWithHost, res)) return
79 79
80 if (!checkUserCanDeleteVideoChannel(res.locals.oauth.token.User, res.locals.videoChannel, res)) return 80 if (!checkUserCanDeleteVideoChannel(res.locals.oauth.token.User, res.locals.videoChannel, res)) return
81 if (!await checkVideoChannelIsNotTheLastOne(res)) return 81 if (!await checkVideoChannelIsNotTheLastOne(res)) return
@@ -92,7 +92,7 @@ const videoChannelsNameWithHostValidator = [
92 92
93 if (areValidationErrors(req, res)) return 93 if (areValidationErrors(req, res)) return
94 94
95 if (!await isVideoChannelNameWithHostExist(req.params.nameWithHost, res)) return 95 if (!await doesVideoChannelNameWithHostExist(req.params.nameWithHost, res)) return
96 96
97 return next() 97 return next()
98 } 98 }
@@ -105,7 +105,7 @@ const localVideoChannelValidator = [
105 logger.debug('Checking localVideoChannelValidator parameters', { parameters: req.params }) 105 logger.debug('Checking localVideoChannelValidator parameters', { parameters: req.params })
106 106
107 if (areValidationErrors(req, res)) return 107 if (areValidationErrors(req, res)) return
108 if (!await isLocalVideoChannelNameExist(req.params.name, res)) return 108 if (!await doesLocalVideoChannelNameExist(req.params.name, res)) return
109 109
110 return next() 110 return next()
111 } 111 }