mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Use video abuse filters on client side
This commit is contained in:
parent
d170c5c580
commit
feb34f6b6b
13 changed files with 343 additions and 154 deletions
|
@ -1,6 +1,8 @@
|
|||
import validator from 'validator'
|
||||
|
||||
import { CONSTRAINTS_FIELDS, VIDEO_ABUSE_STATES } from '../../initializers/constants'
|
||||
import { exists } from './misc'
|
||||
import { VideoAbuseVideoIs } from '@shared/models/videos/abuse/video-abuse-video-is.type'
|
||||
|
||||
const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_ABUSES
|
||||
|
||||
|
@ -16,10 +18,18 @@ function isVideoAbuseStateValid (value: string) {
|
|||
return exists(value) && VIDEO_ABUSE_STATES[value] !== undefined
|
||||
}
|
||||
|
||||
function isAbuseVideoIsValid (value: VideoAbuseVideoIs) {
|
||||
return exists(value) && (
|
||||
value === 'deleted' ||
|
||||
value === 'blacklisted'
|
||||
)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
isVideoAbuseStateValid,
|
||||
isVideoAbuseReasonValid,
|
||||
isAbuseVideoIsValid,
|
||||
isVideoAbuseModerationCommentValid
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue