Skip to main content

Class: CreateUserAsAdminInput

api-login/dto/user-inputs.dto.CreateUserAsAdminInput

Input object for creating a new user as admin. Expects an additional, optional isAdmin parameter

Hierarchy

Constructors

constructor

new CreateUserAsAdminInput()

Inherited from

BaseUserInput.constructor

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

BaseUserInput.displayName

Defined in

login-service/src/api-login/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

BaseUserInput.email

Defined in

login-service/src/api-login/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

login-service/src/api-login/dto/user-inputs.dto.ts:105


username

username: string

The username to set for the new user. Must be given and cannot be empty

Example

"testUser"

Inherited from

BaseUserInput.username

Defined in

login-service/src/api-login/dto/user-inputs.dto.ts:14

Methods

check

Static check(input): CreateUserAsAdminInput

Checks for a valid CreateUserAsAdminInput

Needed:

Parameters

NameTypeDescription
inputCreateUserAsAdminInputThe instance to check

Returns

CreateUserAsAdminInput

The argument unchanged

Throws

HttpException BAD_REQUEST if invalid

Overrides

BaseUserInput.check

Defined in

login-service/src/api-login/dto/user-inputs.dto.ts:118