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/video-channel.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/video-channel.ts')
-rw-r--r-- | server/controllers/api/video-channel.ts | 5 |
1 files changed, 3 insertions, 2 deletions
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' | |||
38 | import { VideoModel } from '../../models/video/video' | 38 | import { VideoModel } from '../../models/video/video' |
39 | import { VideoChannelModel } from '../../models/video/video-channel' | 39 | import { VideoChannelModel } from '../../models/video/video-channel' |
40 | import { VideoPlaylistModel } from '../../models/video/video-playlist' | 40 | import { VideoPlaylistModel } from '../../models/video/video-playlist' |
41 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
41 | 42 | ||
42 | const auditLogger = auditLoggerFactory('channels') | 43 | const auditLogger = auditLoggerFactory('channels') |
43 | const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR }) | 44 | 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) | |||
212 | throw err | 213 | throw err |
213 | } | 214 | } |
214 | 215 | ||
215 | res.type('json').status(204).end() | 216 | res.type('json').status(HttpStatusCode.NO_CONTENT_204).end() |
216 | 217 | ||
217 | // Don't process in a transaction, and after the response because it could be long | 218 | // Don't process in a transaction, and after the response because it could be long |
218 | if (doBulkVideoUpdate) { | 219 | if (doBulkVideoUpdate) { |
@@ -232,7 +233,7 @@ async function removeVideoChannel (req: express.Request, res: express.Response) | |||
232 | logger.info('Video channel %s deleted.', videoChannelInstance.Actor.url) | 233 | logger.info('Video channel %s deleted.', videoChannelInstance.Actor.url) |
233 | }) | 234 | }) |
234 | 235 | ||
235 | return res.type('json').status(204).end() | 236 | return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end() |
236 | } | 237 | } |
237 | 238 | ||
238 | async function getVideoChannel (req: express.Request, res: express.Response) { | 239 | async function getVideoChannel (req: express.Request, res: express.Response) { |