]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/middlewares/video-captions.ts
Fix preview upload with capitalized ext
[github/Chocobozzz/PeerTube.git] / server / helpers / middlewares / video-captions.ts
index 1b2513b60111b306dff9bf00ea64fec24409f47b..226d3c5f8550fd33bd796e2e7679df0f6035b8cf 100644 (file)
@@ -1,14 +1,14 @@
 import { Response } from 'express'
 import { VideoCaptionModel } from '../../models/video/video-caption'
-import { MVideoId } from '@server/typings/models'
+import { MVideoId } from '@server/types/models'
+import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
 
 async function doesVideoCaptionExist (video: MVideoId, language: string, res: Response) {
   const videoCaption = await VideoCaptionModel.loadByVideoIdAndLanguage(video.id, language)
 
   if (!videoCaption) {
-    res.status(404)
+    res.status(HttpStatusCode.NOT_FOUND_404)
        .json({ error: 'Video caption not found' })
-       .end()
 
     return false
   }