diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-10 16:54:01 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-10 16:54:01 +0200 |
commit | 268eebed921ac13a9ce0f4717f4923aa24190657 (patch) | |
tree | 52f8436968c8dcc686663ef5db8dffd7ed191d34 /server/helpers/custom-validators/videos.ts | |
parent | 904a463c7792837f0a468a522a28448323e48593 (diff) | |
download | PeerTube-268eebed921ac13a9ce0f4717f4923aa24190657.tar.gz PeerTube-268eebed921ac13a9ce0f4717f4923aa24190657.tar.zst PeerTube-268eebed921ac13a9ce0f4717f4923aa24190657.zip |
Add state and moderationComment for abuses on server side
Diffstat (limited to 'server/helpers/custom-validators/videos.ts')
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index f4c1c8b07..5e6cfe217 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts | |||
@@ -6,6 +6,7 @@ import * as validator from 'validator' | |||
6 | import { UserRight, VideoPrivacy, VideoRateType } from '../../../shared' | 6 | import { UserRight, VideoPrivacy, VideoRateType } from '../../../shared' |
7 | import { | 7 | import { |
8 | CONSTRAINTS_FIELDS, | 8 | CONSTRAINTS_FIELDS, |
9 | VIDEO_ABUSE_STATES, | ||
9 | VIDEO_CATEGORIES, | 10 | VIDEO_CATEGORIES, |
10 | VIDEO_LICENCES, | 11 | VIDEO_LICENCES, |
11 | VIDEO_MIMETYPE_EXT, | 12 | VIDEO_MIMETYPE_EXT, |
@@ -18,6 +19,7 @@ import { exists, isArray, isFileValid } from './misc' | |||
18 | import { VideoChannelModel } from '../../models/video/video-channel' | 19 | import { VideoChannelModel } from '../../models/video/video-channel' |
19 | import { UserModel } from '../../models/account/user' | 20 | import { UserModel } from '../../models/account/user' |
20 | import * as magnetUtil from 'magnet-uri' | 21 | import * as magnetUtil from 'magnet-uri' |
22 | import { VideoAbuseModel } from '../../models/video/video-abuse' | ||
21 | 23 | ||
22 | const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS | 24 | const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS |
23 | const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_ABUSES | 25 | const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_ABUSES |
@@ -71,10 +73,6 @@ function isVideoTagsValid (tags: string[]) { | |||
71 | ) | 73 | ) |
72 | } | 74 | } |
73 | 75 | ||
74 | function isVideoAbuseReasonValid (value: string) { | ||
75 | return exists(value) && validator.isLength(value, VIDEO_ABUSES_CONSTRAINTS_FIELDS.REASON) | ||
76 | } | ||
77 | |||
78 | function isVideoViewsValid (value: string) { | 76 | function isVideoViewsValid (value: string) { |
79 | return exists(value) && validator.isInt(value + '', VIDEOS_CONSTRAINTS_FIELDS.VIEWS) | 77 | return exists(value) && validator.isInt(value + '', VIDEOS_CONSTRAINTS_FIELDS.VIEWS) |
80 | } | 78 | } |
@@ -220,7 +218,6 @@ export { | |||
220 | isVideoTagsValid, | 218 | isVideoTagsValid, |
221 | isVideoFPSResolutionValid, | 219 | isVideoFPSResolutionValid, |
222 | isScheduleVideoUpdatePrivacyValid, | 220 | isScheduleVideoUpdatePrivacyValid, |
223 | isVideoAbuseReasonValid, | ||
224 | isVideoFile, | 221 | isVideoFile, |
225 | isVideoMagnetUriValid, | 222 | isVideoMagnetUriValid, |
226 | isVideoStateValid, | 223 | isVideoStateValid, |