diff options
Diffstat (limited to 'server/helpers/middlewares/video-captions.ts')
-rw-r--r-- | server/helpers/middlewares/video-captions.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/helpers/middlewares/video-captions.ts b/server/helpers/middlewares/video-captions.ts index f5ce29807..10267eda1 100644 --- a/server/helpers/middlewares/video-captions.ts +++ b/server/helpers/middlewares/video-captions.ts | |||
@@ -1,12 +1,13 @@ | |||
1 | import { Response } from 'express' | 1 | import { Response } from 'express' |
2 | import { VideoCaptionModel } from '../../models/video/video-caption' | 2 | import { VideoCaptionModel } from '../../models/video/video-caption' |
3 | import { MVideoId } from '@server/types/models' | 3 | import { MVideoId } from '@server/types/models' |
4 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
4 | 5 | ||
5 | async function doesVideoCaptionExist (video: MVideoId, language: string, res: Response) { | 6 | async function doesVideoCaptionExist (video: MVideoId, language: string, res: Response) { |
6 | const videoCaption = await VideoCaptionModel.loadByVideoIdAndLanguage(video.id, language) | 7 | const videoCaption = await VideoCaptionModel.loadByVideoIdAndLanguage(video.id, language) |
7 | 8 | ||
8 | if (!videoCaption) { | 9 | if (!videoCaption) { |
9 | res.status(404) | 10 | res.status(HttpStatusCode.NOT_FOUND_404) |
10 | .json({ error: 'Video caption not found' }) | 11 | .json({ error: 'Video caption not found' }) |
11 | .end() | 12 | .end() |
12 | 13 | ||