mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
replace numbers with typed http status codes (#3409)
This commit is contained in:
parent
adc1f09c0d
commit
2d53be0267
149 changed files with 1721 additions and 1108 deletions
|
@ -4,6 +4,7 @@ import { CONSTRAINTS_FIELDS, MIMETYPES, VIDEO_IMPORT_STATES } from '../../initia
|
|||
import { exists, isFileValid } from './misc'
|
||||
import * as express from 'express'
|
||||
import { VideoImportModel } from '../../models/video/video-import'
|
||||
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
|
||||
|
||||
function isVideoImportTargetUrlValid (url: string) {
|
||||
const isURLOptions = {
|
||||
|
@ -35,7 +36,7 @@ async function doesVideoImportExist (id: number, res: express.Response) {
|
|||
const videoImport = await VideoImportModel.loadAndPopulateVideo(id)
|
||||
|
||||
if (!videoImport) {
|
||||
res.status(404)
|
||||
res.status(HttpStatusCode.NOT_FOUND_404)
|
||||
.json({ error: 'Video import not found' })
|
||||
.end()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue