X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fvideo-blacklist.ts;h=9a44332ef2eefdec8498ce1614fa2a702a21a829;hb=22a73cb879a5cc775d4bec3d72fa9c9cf52e5175;hp=3743f70233cb2507036efbc13adc50f1dbcbbaf4;hpb=97567dd81f508dd6295ac4d73d849aa2ce0a6549;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/video-blacklist.ts b/server/helpers/custom-validators/video-blacklist.ts index 3743f7023..9a44332ef 100644 --- a/server/helpers/custom-validators/video-blacklist.ts +++ b/server/helpers/custom-validators/video-blacklist.ts @@ -1,8 +1,6 @@ -import { Response } from 'express' import * as validator from 'validator' import { exists } from './misc' import { CONSTRAINTS_FIELDS } from '../../initializers/constants' -import { VideoBlacklistModel } from '../../models/video/video-blacklist' import { VideoBlacklistType } from '../../../shared/models/videos' const VIDEO_BLACKLIST_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_BLACKLIST @@ -11,21 +9,6 @@ function isVideoBlacklistReasonValid (value: string) { return value === null || validator.isLength(value, VIDEO_BLACKLIST_CONSTRAINTS_FIELDS.REASON) } -async function doesVideoBlacklistExist (videoId: number, res: Response) { - const videoBlacklist = await VideoBlacklistModel.loadByVideoId(videoId) - - if (videoBlacklist === null) { - res.status(404) - .json({ error: 'Blacklisted video not found' }) - .end() - - return false - } - - res.locals.videoBlacklist = videoBlacklist - return true -} - function isVideoBlacklistTypeValid (value: any) { return exists(value) && validator.isInt('' + value) && VideoBlacklistType[value] !== undefined } @@ -34,6 +17,5 @@ function isVideoBlacklistTypeValid (value: any) { export { isVideoBlacklistReasonValid, - isVideoBlacklistTypeValid, - doesVideoBlacklistExist + isVideoBlacklistTypeValid }