mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +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
|
@ -38,6 +38,7 @@ import { AccountModel } from '../../models/account/account'
|
|||
import { VideoModel } from '../../models/video/video'
|
||||
import { VideoChannelModel } from '../../models/video/video-channel'
|
||||
import { VideoPlaylistModel } from '../../models/video/video-playlist'
|
||||
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
|
||||
|
||||
const auditLogger = auditLoggerFactory('channels')
|
||||
const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR })
|
||||
|
@ -212,7 +213,7 @@ async function updateVideoChannel (req: express.Request, res: express.Response)
|
|||
throw err
|
||||
}
|
||||
|
||||
res.type('json').status(204).end()
|
||||
res.type('json').status(HttpStatusCode.NO_CONTENT_204).end()
|
||||
|
||||
// Don't process in a transaction, and after the response because it could be long
|
||||
if (doBulkVideoUpdate) {
|
||||
|
@ -232,7 +233,7 @@ async function removeVideoChannel (req: express.Request, res: express.Response)
|
|||
logger.info('Video channel %s deleted.', videoChannelInstance.Actor.url)
|
||||
})
|
||||
|
||||
return res.type('json').status(204).end()
|
||||
return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end()
|
||||
}
|
||||
|
||||
async function getVideoChannel (req: express.Request, res: express.Response) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue