diff options
Diffstat (limited to 'server/helpers/custom-validators/video-blacklist.ts')
-rw-r--r-- | server/helpers/custom-validators/video-blacklist.ts | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/server/helpers/custom-validators/video-blacklist.ts b/server/helpers/custom-validators/video-blacklist.ts deleted file mode 100644 index 34fcec38e..000000000 --- a/server/helpers/custom-validators/video-blacklist.ts +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | import validator from 'validator' | ||
2 | import { exists } from './misc' | ||
3 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' | ||
4 | import { VideoBlacklistType } from '../../../shared/models/videos' | ||
5 | |||
6 | const VIDEO_BLACKLIST_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_BLACKLIST | ||
7 | |||
8 | function isVideoBlacklistReasonValid (value: string) { | ||
9 | return value === null || validator.isLength(value, VIDEO_BLACKLIST_CONSTRAINTS_FIELDS.REASON) | ||
10 | } | ||
11 | |||
12 | function isVideoBlacklistTypeValid (value: any) { | ||
13 | return exists(value) && | ||
14 | (value === VideoBlacklistType.AUTO_BEFORE_PUBLISHED || value === VideoBlacklistType.MANUAL) | ||
15 | } | ||
16 | |||
17 | // --------------------------------------------------------------------------- | ||
18 | |||
19 | export { | ||
20 | isVideoBlacklistReasonValid, | ||
21 | isVideoBlacklistTypeValid | ||
22 | } | ||