apps/api/src/auth/dto/register.dto.ts
Register Dto Class
Properties |
Type : string
|
Decorators :
@ApiProperty({required: true})
|
|
Defined in apps/api/src/auth/dto/register.dto.ts:22
|
|
Email field |
| name |
Type : string
|
Decorators :
@ApiProperty({required: true})
|
|
Defined in apps/api/src/auth/dto/register.dto.ts:42
|
|
Name field |
| password |
Type : string
|
Decorators :
@ApiProperty({required: true})
|
|
Defined in apps/api/src/auth/dto/register.dto.ts:52
|
|
Password field |
| username |
Type : string
|
Decorators :
@ApiProperty({required: true})
|
|
Defined in apps/api/src/auth/dto/register.dto.ts:32
|
|
Username field |
import { ApiProperty } from '@nestjs/swagger';
import {
IsAlphanumeric,
IsEmail,
IsNotEmpty,
Matches,
MinLength,
} from 'class-validator';
/**
* Register Dto Class
*/
export class RegisterDto {
/**
* Email field
*/
@ApiProperty({
required: true,
})
@IsEmail()
@IsNotEmpty()
email: string;
/**
* Username field
*/
@ApiProperty({
required: true,
})
@IsAlphanumeric()
@IsNotEmpty()
username: string;
/**
* Name field
*/
@ApiProperty({
required: true,
})
@Matches(/^[a-zA-Z ]+$/)
@IsNotEmpty()
name: string;
/**
* Password field
*/
@ApiProperty({
required: true,
})
@IsNotEmpty()
@MinLength(8)
password: string;
}