aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/video-imports.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/helpers/custom-validators/video-imports.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/helpers/custom-validators/video-imports.ts')
-rw-r--r--server/helpers/custom-validators/video-imports.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/video-imports.ts b/server/helpers/custom-validators/video-imports.ts
index 33a1fa8ab..0063d3337 100644
--- a/server/helpers/custom-validators/video-imports.ts
+++ b/server/helpers/custom-validators/video-imports.ts
@@ -4,6 +4,7 @@ import { CONSTRAINTS_FIELDS, MIMETYPES, VIDEO_IMPORT_STATES } from '../../initia
4import { exists, isFileValid } from './misc' 4import { exists, isFileValid } from './misc'
5import * as express from 'express' 5import * as express from 'express'
6import { VideoImportModel } from '../../models/video/video-import' 6import { VideoImportModel } from '../../models/video/video-import'
7import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
7 8
8function isVideoImportTargetUrlValid (url: string) { 9function isVideoImportTargetUrlValid (url: string) {
9 const isURLOptions = { 10 const isURLOptions = {
@@ -35,7 +36,7 @@ async function doesVideoImportExist (id: number, res: express.Response) {
35 const videoImport = await VideoImportModel.loadAndPopulateVideo(id) 36 const videoImport = await VideoImportModel.loadAndPopulateVideo(id)
36 37
37 if (!videoImport) { 38 if (!videoImport) {
38 res.status(404) 39 res.status(HttpStatusCode.NOT_FOUND_404)
39 .json({ error: 'Video import not found' }) 40 .json({ error: 'Video import not found' })
40 .end() 41 .end()
41 42