aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users/my-subscriptions.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-12-07 14:32:36 +0100
committerGitHub <noreply@github.com>2020-12-07 14:32:36 +0100
commit2d53be0267acc49cda46707b885096193a1f4e9c (patch)
tree887061a34bc67f40acbb96a6278f9544bf83caeb /server/controllers/api/users/my-subscriptions.ts
parentadc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff)
downloadPeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.gz
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.zst
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.zip
replace numbers with typed http status codes (#3409)
Diffstat (limited to 'server/controllers/api/users/my-subscriptions.ts')
-rw-r--r--server/controllers/api/users/my-subscriptions.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/controllers/api/users/my-subscriptions.ts b/server/controllers/api/users/my-subscriptions.ts
index 66b33c477..ec77ddd7a 100644
--- a/server/controllers/api/users/my-subscriptions.ts
+++ b/server/controllers/api/users/my-subscriptions.ts
@@ -27,6 +27,7 @@ import {
27import { ActorFollowModel } from '../../../models/activitypub/actor-follow' 27import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
28import { VideoModel } from '../../../models/video/video' 28import { VideoModel } from '../../../models/video/video'
29import { sendUndoFollow } from '@server/lib/activitypub/send' 29import { sendUndoFollow } from '@server/lib/activitypub/send'
30import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
30 31
31const mySubscriptionsRouter = express.Router() 32const mySubscriptionsRouter = express.Router()
32 33
@@ -126,7 +127,7 @@ function addUserSubscription (req: express.Request, res: express.Response) {
126 127
127 JobQueue.Instance.createJob({ type: 'activitypub-follow', payload }) 128 JobQueue.Instance.createJob({ type: 'activitypub-follow', payload })
128 129
129 return res.status(204).end() 130 return res.status(HttpStatusCode.NO_CONTENT_204).end()
130} 131}
131 132
132function getUserSubscription (req: express.Request, res: express.Response) { 133function getUserSubscription (req: express.Request, res: express.Response) {
@@ -144,7 +145,9 @@ async function deleteUserSubscription (req: express.Request, res: express.Respon
144 return subscription.destroy({ transaction: t }) 145 return subscription.destroy({ transaction: t })
145 }) 146 })
146 147
147 return res.type('json').status(204).end() 148 return res.type('json')
149 .status(HttpStatusCode.NO_CONTENT_204)
150 .end()
148} 151}
149 152
150async function getUserSubscriptions (req: express.Request, res: express.Response) { 153async function getUserSubscriptions (req: express.Request, res: express.Response) {