aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/abuses.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-07-08 15:51:46 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-07-10 14:02:41 +0200
commit310b5219b38427f0c2c7ba57225afdd8f3064380 (patch)
tree853ff7e4e66425ca47b0999384eeb08ed14b28ff /server/helpers/custom-validators/abuses.ts
parent811cef146c841ef8530bc812c05dfee77e0f2998 (diff)
downloadPeerTube-310b5219b38427f0c2c7ba57225afdd8f3064380.tar.gz
PeerTube-310b5219b38427f0c2c7ba57225afdd8f3064380.tar.zst
PeerTube-310b5219b38427f0c2c7ba57225afdd8f3064380.zip
Add new abuses tests
Diffstat (limited to 'server/helpers/custom-validators/abuses.ts')
-rw-r--r--server/helpers/custom-validators/abuses.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/abuses.ts b/server/helpers/custom-validators/abuses.ts
index c21468caa..0ca06a252 100644
--- a/server/helpers/custom-validators/abuses.ts
+++ b/server/helpers/custom-validators/abuses.ts
@@ -3,10 +3,10 @@ import { AbuseFilter, abusePredefinedReasonsMap, AbusePredefinedReasonsString, A
3import { ABUSE_STATES, CONSTRAINTS_FIELDS } from '../../initializers/constants' 3import { ABUSE_STATES, CONSTRAINTS_FIELDS } from '../../initializers/constants'
4import { exists, isArray } from './misc' 4import { exists, isArray } from './misc'
5 5
6const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.ABUSES 6const ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.ABUSES
7 7
8function isAbuseReasonValid (value: string) { 8function isAbuseReasonValid (value: string) {
9 return exists(value) && validator.isLength(value, VIDEO_ABUSES_CONSTRAINTS_FIELDS.REASON) 9 return exists(value) && validator.isLength(value, ABUSES_CONSTRAINTS_FIELDS.REASON)
10} 10}
11 11
12function isAbusePredefinedReasonValid (value: AbusePredefinedReasonsString) { 12function isAbusePredefinedReasonValid (value: AbusePredefinedReasonsString) {
@@ -32,7 +32,7 @@ function isAbuseTimestampCoherent (endAt: number, { req }) {
32} 32}
33 33
34function isAbuseModerationCommentValid (value: string) { 34function isAbuseModerationCommentValid (value: string) {
35 return exists(value) && validator.isLength(value, VIDEO_ABUSES_CONSTRAINTS_FIELDS.MODERATION_COMMENT) 35 return exists(value) && validator.isLength(value, ABUSES_CONSTRAINTS_FIELDS.MODERATION_COMMENT)
36} 36}
37 37
38function isAbuseStateValid (value: string) { 38function isAbuseStateValid (value: string) {