1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Create types for model enums

This commit is contained in:
Chocobozzz 2017-06-16 10:36:18 +02:00
parent 70c065d64c
commit ee9e7b61f5
21 changed files with 89 additions and 29 deletions

View file

@ -3,6 +3,8 @@ import * as validator from 'validator'
import { exists } from './misc'
import { CONSTRAINTS_FIELDS, USER_ROLES } from '../../initializers'
import { UserRole } from '../../../shared'
const USERS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.USERS
function isUserPasswordValid (value: string) {
@ -10,7 +12,7 @@ function isUserPasswordValid (value: string) {
}
function isUserRoleValid (value: string) {
return values(USER_ROLES).indexOf(value) !== -1
return values(USER_ROLES).indexOf(value as UserRole) !== -1
}
function isUserUsernameValid (value: string) {