src/users/dto/create-user.dto.ts
Properties |
| Public captcha |
Type : string
|
Decorators :
@IsNotEmpty()
|
|
Defined in src/users/dto/create-user.dto.ts:39
|
| Public email |
Type : string
|
Decorators :
@IsEmail(undefined, {message: undefined})
|
|
Defined in src/users/dto/create-user.dto.ts:12
|
| Public password |
Type : string
|
Decorators :
@MinLength(8, {message: undefined})
|
|
Defined in src/users/dto/create-user.dto.ts:35
|
| Public username |
Type : string
|
Decorators :
@MinLength(4, {message: undefined})
|
|
Defined in src/users/dto/create-user.dto.ts:24
|
import { IsEmail, IsNotEmpty, MaxLength, MinLength } from 'class-validator';
import { IsUrlSafe } from '../../common/decorators/urlsafe.decorator';
import { RegisterRespEnum } from '../../utils/enums/responses/register.enum';
export default class CreateUserDto {
@IsEmail(undefined, {
message: RegisterRespEnum.ERR_INVALID_EMAIL,
})
@IsNotEmpty({
message: RegisterRespEnum.ERR_INVALID_EMAIL,
})
public email: string;
@MinLength(4, {
message: RegisterRespEnum.ERR_USERNAME_TOOSHORT,
})
@MaxLength(16, {
message: RegisterRespEnum.ERR_USERNAME_TOOLONG,
})
@IsNotEmpty({
message: RegisterRespEnum.ERR_USERNAME_INVALID,
})
@IsUrlSafe()
public username: string;
@MinLength(8, {
message: RegisterRespEnum.ERR_PASSWORD_TOOSHORT,
})
@MaxLength(128, {
message: RegisterRespEnum.ERR_PASSWORD_TOOLONG,
})
@IsNotEmpty({
message: RegisterRespEnum.ERR_PASSWORD_INVALID,
})
public password: string;
//controlled by guard
@IsNotEmpty()
public captcha: string;
}