mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Resolve enums at compile time
This commit is contained in:
parent
81d02aac56
commit
fba87e27c1
5 changed files with 5 additions and 5 deletions
|
@ -90,7 +90,7 @@ function isUserBlockedReasonValid (value: any) {
|
|||
}
|
||||
|
||||
function isUserRoleValid (value: any) {
|
||||
return exists(value) && validator.isInt('' + value) && UserRole[value] !== undefined
|
||||
return exists(value) && validator.isInt('' + value) && [ UserRole.ADMINISTRATOR, UserRole.MODERATOR, UserRole.USER ].includes(value)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue