mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 00:24:54 +00:00
fix: add gender property to UserResponseDto
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { Gender } from '~/customer/enums';
|
||||
import { DocumentMetaResponseDto } from '~/document/dtos/response';
|
||||
import { User } from '~/user/entities';
|
||||
|
||||
@ -33,6 +34,10 @@ export class UserResponseDto {
|
||||
@ApiProperty()
|
||||
isEmailVerified!: boolean;
|
||||
|
||||
@ApiPropertyOptional({ enum: Gender, nullable: true })
|
||||
gender!: Gender | null;
|
||||
|
||||
|
||||
constructor(user: User) {
|
||||
this.id = user.id;
|
||||
this.countryCode = user.countryCode;
|
||||
@ -44,5 +49,6 @@ export class UserResponseDto {
|
||||
this.profilePicture = user.profilePicture ? new DocumentMetaResponseDto(user.profilePicture) : null;
|
||||
this.isEmailVerified = user.isEmailVerified;
|
||||
this.isPhoneVerified = user.isPhoneVerified;
|
||||
this.gender = (user.customer?.gender as Gender) || null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user