diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/audit-logger.ts | 4 | ||||
-rw-r--r-- | server/helpers/custom-validators/abuses.ts | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/server/helpers/audit-logger.ts b/server/helpers/audit-logger.ts index 954b0b69d..6aae5e821 100644 --- a/server/helpers/audit-logger.ts +++ b/server/helpers/audit-logger.ts | |||
@@ -5,7 +5,7 @@ import { chain } from 'lodash' | |||
5 | import * as path from 'path' | 5 | import * as path from 'path' |
6 | import * as winston from 'winston' | 6 | import * as winston from 'winston' |
7 | import { AUDIT_LOG_FILENAME } from '@server/initializers/constants' | 7 | import { AUDIT_LOG_FILENAME } from '@server/initializers/constants' |
8 | import { Abuse, User, VideoChannel, VideoDetails, VideoImport } from '../../shared' | 8 | import { AdminAbuse, User, VideoChannel, VideoDetails, VideoImport } from '../../shared' |
9 | import { CustomConfig } from '../../shared/models/server/custom-config.model' | 9 | import { CustomConfig } from '../../shared/models/server/custom-config.model' |
10 | import { VideoComment } from '../../shared/models/videos/video-comment.model' | 10 | import { VideoComment } from '../../shared/models/videos/video-comment.model' |
11 | import { CONFIG } from '../initializers/config' | 11 | import { CONFIG } from '../initializers/config' |
@@ -219,7 +219,7 @@ const abuseKeysToKeep = [ | |||
219 | 'createdAt' | 219 | 'createdAt' |
220 | ] | 220 | ] |
221 | class AbuseAuditView extends EntityAuditView { | 221 | class AbuseAuditView extends EntityAuditView { |
222 | constructor (private readonly abuse: Abuse) { | 222 | constructor (private readonly abuse: AdminAbuse) { |
223 | super(abuseKeysToKeep, 'abuse', abuse) | 223 | super(abuseKeysToKeep, 'abuse', abuse) |
224 | } | 224 | } |
225 | } | 225 | } |
diff --git a/server/helpers/custom-validators/abuses.ts b/server/helpers/custom-validators/abuses.ts index 0ca06a252..0ddde4b06 100644 --- a/server/helpers/custom-validators/abuses.ts +++ b/server/helpers/custom-validators/abuses.ts | |||
@@ -4,6 +4,7 @@ import { ABUSE_STATES, CONSTRAINTS_FIELDS } from '../../initializers/constants' | |||
4 | import { exists, isArray } from './misc' | 4 | import { exists, isArray } from './misc' |
5 | 5 | ||
6 | const ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.ABUSES | 6 | const ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.ABUSES |
7 | const ABUSE_MESSAGES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.ABUSE_MESSAGES | ||
7 | 8 | ||
8 | function isAbuseReasonValid (value: string) { | 9 | function isAbuseReasonValid (value: string) { |
9 | return exists(value) && validator.isLength(value, ABUSES_CONSTRAINTS_FIELDS.REASON) | 10 | return exists(value) && validator.isLength(value, ABUSES_CONSTRAINTS_FIELDS.REASON) |
@@ -46,13 +47,18 @@ function isAbuseVideoIsValid (value: AbuseVideoIs) { | |||
46 | ) | 47 | ) |
47 | } | 48 | } |
48 | 49 | ||
50 | function isAbuseMessageValid (value: string) { | ||
51 | return exists(value) && validator.isLength(value, ABUSE_MESSAGES_CONSTRAINTS_FIELDS.MESSAGE) | ||
52 | } | ||
53 | |||
49 | // --------------------------------------------------------------------------- | 54 | // --------------------------------------------------------------------------- |
50 | 55 | ||
51 | export { | 56 | export { |
52 | isAbuseReasonValid, | 57 | isAbuseReasonValid, |
53 | isAbuseFilterValid, | 58 | isAbuseFilterValid, |
54 | isAbusePredefinedReasonValid, | 59 | isAbusePredefinedReasonValid, |
55 | areAbusePredefinedReasonsValid as isAbusePredefinedReasonsValid, | 60 | isAbuseMessageValid, |
61 | areAbusePredefinedReasonsValid, | ||
56 | isAbuseTimestampValid, | 62 | isAbuseTimestampValid, |
57 | isAbuseTimestampCoherent, | 63 | isAbuseTimestampCoherent, |
58 | isAbuseModerationCommentValid, | 64 | isAbuseModerationCommentValid, |