1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

replace numbers with typed http status codes (#3409)

This commit is contained in:
Rigel Kent 2020-12-07 14:32:36 +01:00 committed by GitHub
parent adc1f09c0d
commit 2d53be0267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
149 changed files with 1721 additions and 1108 deletions

View file

@ -27,6 +27,7 @@ import {
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
import { VideoModel } from '../../../models/video/video'
import { sendUndoFollow } from '@server/lib/activitypub/send'
import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
const mySubscriptionsRouter = express.Router()
@ -126,7 +127,7 @@ function addUserSubscription (req: express.Request, res: express.Response) {
JobQueue.Instance.createJob({ type: 'activitypub-follow', payload })
return res.status(204).end()
return res.status(HttpStatusCode.NO_CONTENT_204).end()
}
function getUserSubscription (req: express.Request, res: express.Response) {
@ -144,7 +145,9 @@ async function deleteUserSubscription (req: express.Request, res: express.Respon
return subscription.destroy({ transaction: t })
})
return res.type('json').status(204).end()
return res.type('json')
.status(HttpStatusCode.NO_CONTENT_204)
.end()
}
async function getUserSubscriptions (req: express.Request, res: express.Response) {