diff options
Diffstat (limited to 'server/middlewares/validators/user-subscriptions.ts')
-rw-r--r-- | server/middlewares/validators/user-subscriptions.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/middlewares/validators/user-subscriptions.ts b/server/middlewares/validators/user-subscriptions.ts index f331b6c34..d8c26c742 100644 --- a/server/middlewares/validators/user-subscriptions.ts +++ b/server/middlewares/validators/user-subscriptions.ts | |||
@@ -20,11 +20,11 @@ const userSubscriptionAddValidator = [ | |||
20 | } | 20 | } |
21 | ] | 21 | ] |
22 | 22 | ||
23 | const userSubscriptionRemoveValidator = [ | 23 | const userSubscriptionGetValidator = [ |
24 | param('uri').custom(isValidActorHandle).withMessage('Should have a valid URI to unfollow'), | 24 | param('uri').custom(isValidActorHandle).withMessage('Should have a valid URI to unfollow'), |
25 | 25 | ||
26 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 26 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
27 | logger.debug('Checking unfollow parameters', { parameters: req.params }) | 27 | logger.debug('Checking userSubscriptionGetValidator parameters', { parameters: req.params }) |
28 | 28 | ||
29 | if (areValidationErrors(req, res)) return | 29 | if (areValidationErrors(req, res)) return |
30 | 30 | ||
@@ -34,7 +34,7 @@ const userSubscriptionRemoveValidator = [ | |||
34 | const user: UserModel = res.locals.oauth.token.User | 34 | const user: UserModel = res.locals.oauth.token.User |
35 | const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHost(user.Account.Actor.id, name, host) | 35 | const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHost(user.Account.Actor.id, name, host) |
36 | 36 | ||
37 | if (!subscription) { | 37 | if (!subscription || !subscription.ActorFollowing.VideoChannel) { |
38 | return res | 38 | return res |
39 | .status(404) | 39 | .status(404) |
40 | .json({ | 40 | .json({ |
@@ -52,7 +52,7 @@ const userSubscriptionRemoveValidator = [ | |||
52 | 52 | ||
53 | export { | 53 | export { |
54 | userSubscriptionAddValidator, | 54 | userSubscriptionAddValidator, |
55 | userSubscriptionRemoveValidator | 55 | userSubscriptionGetValidator |
56 | } | 56 | } |
57 | 57 | ||
58 | // --------------------------------------------------------------------------- | 58 | // --------------------------------------------------------------------------- |