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