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/users.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/users.ts')
-rw-r--r-- | server/helpers/custom-validators/users.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/users.ts b/server/helpers/custom-validators/users.ts index 7792ffd74..750563ada 100644 --- a/server/helpers/custom-validators/users.ts +++ b/server/helpers/custom-validators/users.ts | |||
@@ -3,6 +3,8 @@ import * as validator from 'validator' | |||
3 | 3 | ||
4 | import { exists } from './misc' | 4 | import { exists } from './misc' |
5 | import { CONSTRAINTS_FIELDS, USER_ROLES } from '../../initializers' | 5 | import { CONSTRAINTS_FIELDS, USER_ROLES } from '../../initializers' |
6 | import { UserRole } from '../../../shared' | ||
7 | |||
6 | const USERS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.USERS | 8 | const USERS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.USERS |
7 | 9 | ||
8 | function isUserPasswordValid (value: string) { | 10 | function isUserPasswordValid (value: string) { |
@@ -10,7 +12,7 @@ function isUserPasswordValid (value: string) { | |||
10 | } | 12 | } |
11 | 13 | ||
12 | function isUserRoleValid (value: string) { | 14 | function isUserRoleValid (value: string) { |
13 | return values(USER_ROLES).indexOf(value) !== -1 | 15 | return values(USER_ROLES).indexOf(value as UserRole) !== -1 |
14 | } | 16 | } |
15 | 17 | ||
16 | function isUserUsernameValid (value: string) { | 18 | function isUserUsernameValid (value: string) { |