aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/video-channel.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-12-07 14:32:36 +0100
committerGitHub <noreply@github.com>2020-12-07 14:32:36 +0100
commit2d53be0267acc49cda46707b885096193a1f4e9c (patch)
tree887061a34bc67f40acbb96a6278f9544bf83caeb /server/controllers/api/video-channel.ts
parentadc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff)
downloadPeerTube-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.ts5
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'
38import { VideoModel } from '../../models/video/video' 38import { VideoModel } from '../../models/video/video'
39import { VideoChannelModel } from '../../models/video/video-channel' 39import { VideoChannelModel } from '../../models/video/video-channel'
40import { VideoPlaylistModel } from '../../models/video/video-playlist' 40import { VideoPlaylistModel } from '../../models/video/video-playlist'
41import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
41 42
42const auditLogger = auditLoggerFactory('channels') 43const auditLogger = auditLoggerFactory('channels')
43const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR }) 44const 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
238async function getVideoChannel (req: express.Request, res: express.Response) { 239async function getVideoChannel (req: express.Request, res: express.Response) {