From 2d53be0267acc49cda46707b885096193a1f4e9c Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 7 Dec 2020 14:32:36 +0100 Subject: replace numbers with typed http status codes (#3409) --- server/controllers/api/video-channel.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server/controllers/api/video-channel.ts') diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index 45c936978..5c96950c5 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts @@ -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) { -- cgit v1.2.3