diff options
Diffstat (limited to 'server/middlewares/validators/videos/video-channels.ts')
-rw-r--r-- | server/middlewares/validators/videos/video-channels.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/middlewares/validators/videos/video-channels.ts b/server/middlewares/validators/videos/video-channels.ts index a0df03f7e..d21274527 100644 --- a/server/middlewares/validators/videos/video-channels.ts +++ b/server/middlewares/validators/videos/video-channels.ts | |||
@@ -13,8 +13,7 @@ import { isActorPreferredUsernameValid } from '../../../helpers/custom-validator | |||
13 | import { ActorModel } from '../../../models/activitypub/actor' | 13 | import { ActorModel } from '../../../models/activitypub/actor' |
14 | import { isBooleanValid } from '../../../helpers/custom-validators/misc' | 14 | import { isBooleanValid } from '../../../helpers/custom-validators/misc' |
15 | import { doesLocalVideoChannelNameExist, doesVideoChannelNameWithHostExist } from '../../../helpers/middlewares' | 15 | import { doesLocalVideoChannelNameExist, doesVideoChannelNameWithHostExist } from '../../../helpers/middlewares' |
16 | import { MChannelActorAccountDefault } from '../../../typings/models/video' | 16 | import { MChannelAccountDefault, MUser } from '@server/typings/models' |
17 | import { MUser } from '@server/typings/models' | ||
18 | 17 | ||
19 | const videoChannelsAddValidator = [ | 18 | const 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'), |
@@ -132,7 +131,7 @@ export { | |||
132 | 131 | ||
133 | // --------------------------------------------------------------------------- | 132 | // --------------------------------------------------------------------------- |
134 | 133 | ||
135 | function checkUserCanDeleteVideoChannel (user: MUser, videoChannel: MChannelActorAccountDefault, res: express.Response) { | 134 | function checkUserCanDeleteVideoChannel (user: MUser, videoChannel: MChannelAccountDefault, res: express.Response) { |
136 | if (videoChannel.Actor.isOwned() === false) { | 135 | if (videoChannel.Actor.isOwned() === false) { |
137 | res.status(403) | 136 | res.status(403) |
138 | .json({ error: 'Cannot remove video channel of another server.' }) | 137 | .json({ error: 'Cannot remove video channel of another server.' }) |