aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/video-abuses.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators/video-abuses.ts')
-rw-r--r--server/helpers/custom-validators/video-abuses.ts16
1 files changed, 0 insertions, 16 deletions
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) {
18 return exists(value) && VIDEO_ABUSE_STATES[ value ] !== undefined 18 return exists(value) && VIDEO_ABUSE_STATES[ value ] !== undefined
19} 19}
20 20
21async function doesVideoAbuseExist (abuseId: number, videoId: number, res: Response) {
22 const videoAbuse = await VideoAbuseModel.loadByIdAndVideoId(abuseId, videoId)
23
24 if (videoAbuse === null) {
25 res.status(404)
26 .json({ error: 'Video abuse not found' })
27 .end()
28
29 return false
30 }
31
32 res.locals.videoAbuse = videoAbuse
33 return true
34}
35
36// --------------------------------------------------------------------------- 21// ---------------------------------------------------------------------------
37 22
38export { 23export {
39 doesVideoAbuseExist,
40 isVideoAbuseStateValid, 24 isVideoAbuseStateValid,
41 isVideoAbuseReasonValid, 25 isVideoAbuseReasonValid,
42 isVideoAbuseModerationCommentValid 26 isVideoAbuseModerationCommentValid