diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-07 14:32:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 14:32:36 +0100 |
commit | 2d53be0267acc49cda46707b885096193a1f4e9c (patch) | |
tree | 887061a34bc67f40acbb96a6278f9544bf83caeb /server/controllers/api/users/my-subscriptions.ts | |
parent | adc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff) | |
download | PeerTube-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.ts | 7 |
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 { | |||
27 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' | 27 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' |
28 | import { VideoModel } from '../../../models/video/video' | 28 | import { VideoModel } from '../../../models/video/video' |
29 | import { sendUndoFollow } from '@server/lib/activitypub/send' | 29 | import { sendUndoFollow } from '@server/lib/activitypub/send' |
30 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
30 | 31 | ||
31 | const mySubscriptionsRouter = express.Router() | 32 | const 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 | ||
132 | function getUserSubscription (req: express.Request, res: express.Response) { | 133 | function 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 | ||
150 | async function getUserSubscriptions (req: express.Request, res: express.Response) { | 153 | async function getUserSubscriptions (req: express.Request, res: express.Response) { |