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:
parent
adc1f09c0d
commit
2d53be0267
149 changed files with 1721 additions and 1108 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue