apps/api/src/users/dto/patch-user.dto.ts
Patch User Payload Class
Properties |
Type : string
|
Decorators :
@ApiProperty()
|
Defined in apps/api/src/users/dto/patch-user.dto.ts:20
|
Email field |
name |
Type : string
|
Decorators :
@ApiProperty()
|
Defined in apps/api/src/users/dto/patch-user.dto.ts:38
|
Name field |
password |
Type : string
|
Decorators :
@ApiProperty()
|
Defined in apps/api/src/users/dto/patch-user.dto.ts:46
|
Password field |
username |
Type : string
|
Decorators :
@ApiProperty({required: true})
|
Defined in apps/api/src/users/dto/patch-user.dto.ts:30
|
Username field |
import { ApiProperty } from '@nestjs/swagger';
import {
IsAlphanumeric,
IsEmail,
IsNotEmpty,
Matches,
MinLength,
} from 'class-validator';
/**
* Patch User Payload Class
*/
export class PatchUserDto {
/**
* Email field
*/
@ApiProperty()
@IsEmail()
@IsNotEmpty()
email: string;
/**
* Username field
*/
@ApiProperty({
required: true,
})
@IsAlphanumeric()
@IsNotEmpty()
username: string;
/**
* Name field
*/
@ApiProperty()
@Matches(/^[a-zA-Z ]+$/)
@IsNotEmpty()
name: string;
/**
* Password field
*/
@ApiProperty()
@IsNotEmpty()
@MinLength(8)
password: string;
}