cr
This commit is contained in:
@@ -4,25 +4,25 @@ import {
|
||||
IsOptional,
|
||||
IsBoolean,
|
||||
MinLength,
|
||||
} from 'class-validator';
|
||||
import { ApiProperty, ApiPropertyOptional, PartialType } from '@nestjs/swagger';
|
||||
} from "class-validator";
|
||||
import { ApiProperty, ApiPropertyOptional, PartialType } from "@nestjs/swagger";
|
||||
|
||||
export class CreateUserDto {
|
||||
@ApiPropertyOptional({ example: 'user@example.com' })
|
||||
@ApiPropertyOptional({ example: "user@example.com" })
|
||||
@IsEmail()
|
||||
email: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'password123', minLength: 8 })
|
||||
@ApiPropertyOptional({ example: "password123", minLength: 8 })
|
||||
@IsString()
|
||||
@MinLength(8)
|
||||
password: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'John' })
|
||||
@ApiPropertyOptional({ example: "John" })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
firstName?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'Doe' })
|
||||
@ApiPropertyOptional({ example: "Doe" })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
lastName?: string;
|
||||
@@ -34,12 +34,12 @@ export class CreateUserDto {
|
||||
}
|
||||
|
||||
export class UpdateUserDto extends PartialType(CreateUserDto) {
|
||||
@ApiPropertyOptional({ example: 'John' })
|
||||
@ApiPropertyOptional({ example: "John" })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
firstName?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'Doe' })
|
||||
@ApiPropertyOptional({ example: "Doe" })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
lastName?: string;
|
||||
@@ -51,29 +51,29 @@ export class UpdateUserDto extends PartialType(CreateUserDto) {
|
||||
}
|
||||
|
||||
export class UpdateProfileDto {
|
||||
@ApiPropertyOptional({ example: 'John' })
|
||||
@ApiPropertyOptional({ example: "John" })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
firstName?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'Doe' })
|
||||
@ApiPropertyOptional({ example: "Doe" })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
lastName?: string;
|
||||
}
|
||||
|
||||
export class ChangePasswordDto {
|
||||
@ApiProperty({ example: 'oldPassword123' })
|
||||
@ApiProperty({ example: "oldPassword123" })
|
||||
@IsString()
|
||||
currentPassword: string;
|
||||
|
||||
@ApiProperty({ example: 'newPassword456', minLength: 8 })
|
||||
@ApiProperty({ example: "newPassword456", minLength: 8 })
|
||||
@IsString()
|
||||
@MinLength(8)
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
import { Exclude, Expose } from 'class-transformer';
|
||||
import { Exclude, Expose } from "class-transformer";
|
||||
|
||||
@Exclude()
|
||||
export class UserResponseDto {
|
||||
|
||||
Reference in New Issue
Block a user