fix: dto returns
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
import { Expose, plainToClass } from "class-transformer";
|
||||
import { IsEmail, IsNotEmpty, IsString } from "class-validator";
|
||||
|
||||
export class AuthDTO {
|
||||
@Expose()
|
||||
id: string;
|
||||
|
||||
@Expose()
|
||||
firstName: string;
|
||||
|
||||
@Expose()
|
||||
lastName: string;
|
||||
|
||||
@Expose()
|
||||
@IsNotEmpty()
|
||||
@IsEmail()
|
||||
email: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
password: string;
|
||||
|
||||
constructor(partial: Partial<AuthDTO>) {
|
||||
return plainToClass(AuthDTO, partial, { excludeExtraneousValues: true });
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PickType } from "@nestjs/swagger";
|
||||
import { AuthDTO } from "./auth.dto";
|
||||
import { UserDTO } from "src/user/dto/user.dto";
|
||||
|
||||
export class AuthRegisterDTO extends AuthDTO {}
|
||||
export class AuthRegisterDTO extends UserDTO {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { PickType } from "@nestjs/swagger";
|
||||
import { AuthDTO } from "./auth.dto";
|
||||
import { UserDTO } from "src/user/dto/user.dto";
|
||||
|
||||
export class AuthSignInDTO extends PickType(AuthDTO, [
|
||||
export class AuthSignInDTO extends PickType(UserDTO, [
|
||||
"email",
|
||||
"password",
|
||||
] as const) {}
|
||||
|
||||
Reference in New Issue
Block a user