aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/user-subscriptions.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-21 10:34:18 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 09:41:54 +0200
commit99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd (patch)
treee442f6cdf0cb622cb78f64d0d9de23bfb6deb951 /server/middlewares/validators/user-subscriptions.ts
parent8a19bee1a1ee39f973bb37429e4f73c3f2873cdb (diff)
downloadPeerTube-99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd.tar.gz
PeerTube-99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd.tar.zst
PeerTube-99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd.zip
Add get subscription endpoint
Diffstat (limited to 'server/middlewares/validators/user-subscriptions.ts')
-rw-r--r--server/middlewares/validators/user-subscriptions.ts8
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
23const userSubscriptionRemoveValidator = [ 23const 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
53export { 53export {
54 userSubscriptionAddValidator, 54 userSubscriptionAddValidator,
55 userSubscriptionRemoveValidator 55 userSubscriptionGetValidator
56} 56}
57 57
58// --------------------------------------------------------------------------- 58// ---------------------------------------------------------------------------