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:
parent
70c065d64c
commit
ee9e7b61f5
21 changed files with 89 additions and 29 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue