28 lines
769 B
TypeScript
28 lines
769 B
TypeScript
import { IsString, IsEmail, MinLength, IsOptional } from 'class-validator';
|
|
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
export class UpdateUserDto {
|
|
@ApiPropertyOptional({ description: 'New email address', example: 'newemail@example.com' })
|
|
@IsOptional()
|
|
@IsEmail()
|
|
email?: string;
|
|
|
|
@ApiPropertyOptional({ description: 'New username', example: 'newusername' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MinLength(3)
|
|
username?: string;
|
|
}
|
|
|
|
export class UpdatePasswordDto {
|
|
@ApiPropertyOptional({ description: 'Current password', example: 'oldpassword123' })
|
|
@IsString()
|
|
@MinLength(6)
|
|
currentPassword: string;
|
|
|
|
@ApiPropertyOptional({ description: 'New password', example: 'newpassword123' })
|
|
@IsString()
|
|
@MinLength(6)
|
|
newPassword: string;
|
|
}
|