Class: CreateUserAsAdminInput
api-login/auth/dto/user-inputs.dto.CreateUserAsAdminInput
Input object for creating a new user as admin. Expects an additional, optional isAdmin parameter
Hierarchy
↳
CreateUserAsAdminInput
Constructors
constructor
• new CreateUserAsAdminInput()
Inherited from
Properties
displayName
• displayName: string
The name to display in the UI for the new user. Must be given and can't be empty
Example
"Test User"
Inherited from
Defined in
gropius-login-service/backend/src/api-login/auth/dto/user-inputs.dto.ts:22
email
• Optional
email: string
The email of the new user. Can be ommitted, but if given can't be empty.
Example
"test-user@example.com"
Inherited from
Defined in
gropius-login-service/backend/src/api-login/auth/dto/user-inputs.dto.ts:30
isAdmin
• Optional
isAdmin: boolean
Set whether the newly created user will be an administrator.
If not given, defaults to false
Example
false
Defined in
gropius-login-service/backend/src/api-login/auth/dto/user-inputs.dto.ts:75
username
• username: string
The username to set for the new user. Must be given and cannot be empty
Example
"testUser"
Inherited from
Defined in
gropius-login-service/backend/src/api-login/auth/dto/user-inputs.dto.ts:14
Methods
check
▸ Static
check(input
): CreateUserAsAdminInput
Checks for a valid CreateUserAsAdminInput
Needed:
- Valid BaseUserInput
isAdmin
is, if given, a valid boolean
Parameters
Name | Type | Description |
---|---|---|
input | CreateUserAsAdminInput | The instance to check |
Returns
The argument unchanged
Throws
HttpException BAD_REQUEST if invalid
Overrides
Defined in
gropius-login-service/backend/src/api-login/auth/dto/user-inputs.dto.ts:88