X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fvideo-abuses.ts;h=e43d12be8b9bdae01896dbba6a26d5cbdf206582;hb=d5c8932a601c1854db0a2e399ccaf26e17385f1a;hp=a61dcee1cd9ef8df9cc9809647d6b87d8d9d4001;hpb=74dc3bca2b14f5fd3fe80c394dfc34177a46db77;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/video-abuses.ts b/server/helpers/custom-validators/video-abuses.ts index a61dcee1c..e43d12be8 100644 --- a/server/helpers/custom-validators/video-abuses.ts +++ b/server/helpers/custom-validators/video-abuses.ts @@ -18,25 +18,9 @@ function isVideoAbuseStateValid (value: string) { return exists(value) && VIDEO_ABUSE_STATES[ value ] !== undefined } -async function doesVideoAbuseExist (abuseId: number, videoId: number, res: Response) { - const videoAbuse = await VideoAbuseModel.loadByIdAndVideoId(abuseId, videoId) - - if (videoAbuse === null) { - res.status(404) - .json({ error: 'Video abuse not found' }) - .end() - - return false - } - - res.locals.videoAbuse = videoAbuse - return true -} - // --------------------------------------------------------------------------- export { - doesVideoAbuseExist, isVideoAbuseStateValid, isVideoAbuseReasonValid, isVideoAbuseModerationCommentValid