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/videos/captions.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/videos/captions.ts')
-rw-r--r-- | server/controllers/api/videos/captions.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/controllers/api/videos/captions.ts b/server/controllers/api/videos/captions.ts index c4e2ee72c..bf82e2c19 100644 --- a/server/controllers/api/videos/captions.ts +++ b/server/controllers/api/videos/captions.ts | |||
@@ -11,6 +11,7 @@ import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' | |||
11 | import { CONFIG } from '../../../initializers/config' | 11 | import { CONFIG } from '../../../initializers/config' |
12 | import { sequelizeTypescript } from '../../../initializers/database' | 12 | import { sequelizeTypescript } from '../../../initializers/database' |
13 | import { MVideoCaptionVideo } from '@server/types/models' | 13 | import { MVideoCaptionVideo } from '@server/types/models' |
14 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
14 | 15 | ||
15 | const reqVideoCaptionAdd = createReqFiles( | 16 | const reqVideoCaptionAdd = createReqFiles( |
16 | [ 'captionfile' ], | 17 | [ 'captionfile' ], |
@@ -72,7 +73,7 @@ async function addVideoCaption (req: express.Request, res: express.Response) { | |||
72 | await federateVideoIfNeeded(video, false, t) | 73 | await federateVideoIfNeeded(video, false, t) |
73 | }) | 74 | }) |
74 | 75 | ||
75 | return res.status(204).end() | 76 | return res.status(HttpStatusCode.NO_CONTENT_204).end() |
76 | } | 77 | } |
77 | 78 | ||
78 | async function deleteVideoCaption (req: express.Request, res: express.Response) { | 79 | async function deleteVideoCaption (req: express.Request, res: express.Response) { |
@@ -88,5 +89,5 @@ async function deleteVideoCaption (req: express.Request, res: express.Response) | |||
88 | 89 | ||
89 | logger.info('Video caption %s of video %s deleted.', videoCaption.language, video.uuid) | 90 | logger.info('Video caption %s of video %s deleted.', videoCaption.language, video.uuid) |
90 | 91 | ||
91 | return res.type('json').status(204).end() | 92 | return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end() |
92 | } | 93 | } |