diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 10:36:18 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 10:36:18 +0200 |
commit | ee9e7b61f59a427208386738057c8eff48fba599 (patch) | |
tree | 9097de886128e15f21f0b5920a2076d16a087467 /server/helpers/custom-validators/videos.ts | |
parent | 70c065d64c330196d371941d9294a55da6e3aa37 (diff) | |
download | PeerTube-ee9e7b61f59a427208386738057c8eff48fba599.tar.gz PeerTube-ee9e7b61f59a427208386738057c8eff48fba599.tar.zst PeerTube-ee9e7b61f59a427208386738057c8eff48fba599.zip |
Create types for model enums
Diffstat (limited to 'server/helpers/custom-validators/videos.ts')
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index 8904975c0..72d226e81 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts | |||
@@ -11,6 +11,7 @@ import { | |||
11 | } from '../../initializers' | 11 | } from '../../initializers' |
12 | import { isUserUsernameValid } from './users' | 12 | import { isUserUsernameValid } from './users' |
13 | import { isArray, exists } from './misc' | 13 | import { isArray, exists } from './misc' |
14 | import { VideoRateType } from '../../../shared' | ||
14 | 15 | ||
15 | const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS | 16 | const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS |
16 | const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_ABUSES | 17 | const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_ABUSES |
@@ -105,7 +106,7 @@ function isVideoEventCountValid (value: string) { | |||
105 | } | 106 | } |
106 | 107 | ||
107 | function isVideoRatingTypeValid (value: string) { | 108 | function isVideoRatingTypeValid (value: string) { |
108 | return values(VIDEO_RATE_TYPES).indexOf(value) !== -1 | 109 | return values(VIDEO_RATE_TYPES).indexOf(value as VideoRateType) !== -1 |
109 | } | 110 | } |
110 | 111 | ||
111 | function isVideoFile (value: string, files: { [ fieldname: string ]: Express.Multer.File[] }) { | 112 | function isVideoFile (value: string, files: { [ fieldname: string ]: Express.Multer.File[] }) { |