mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 16:44:54 +00:00
feat: working on edit profile ticket
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Roles } from '~/auth/enums';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { DocumentMetaResponseDto } from '~/document/dtos/response';
|
||||
import { User } from '~/user/entities';
|
||||
|
||||
export class UserResponseDto {
|
||||
@ -7,42 +7,39 @@ export class UserResponseDto {
|
||||
id!: string;
|
||||
|
||||
@ApiProperty()
|
||||
email!: string;
|
||||
countryCode!: string;
|
||||
|
||||
@ApiProperty()
|
||||
phoneNumber!: string;
|
||||
|
||||
@ApiProperty()
|
||||
countryCode!: string;
|
||||
email!: string;
|
||||
|
||||
@ApiProperty()
|
||||
isPasswordSet!: boolean;
|
||||
firstName!: string;
|
||||
|
||||
@ApiProperty()
|
||||
isProfileCompleted!: boolean;
|
||||
lastName!: string;
|
||||
|
||||
@ApiPropertyOptional({ type: DocumentMetaResponseDto, nullable: true })
|
||||
profilePicture!: DocumentMetaResponseDto | null;
|
||||
|
||||
@ApiProperty()
|
||||
isSmsEnabled!: boolean;
|
||||
isPhoneVerified!: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
isEmailEnabled!: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
isPushEnabled!: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
roles!: Roles[];
|
||||
isEmailVerified!: boolean;
|
||||
|
||||
constructor(user: User) {
|
||||
this.id = user.id;
|
||||
this.email = user.email;
|
||||
this.phoneNumber = user.phoneNumber;
|
||||
this.countryCode = user.countryCode;
|
||||
this.isPasswordSet = user.isPasswordSet;
|
||||
this.isProfileCompleted = user.isProfileCompleted;
|
||||
this.isSmsEnabled = user.isSmsEnabled;
|
||||
this.isEmailEnabled = user.isEmailEnabled;
|
||||
this.isPushEnabled = user.isPushEnabled;
|
||||
this.roles = user.roles;
|
||||
this.phoneNumber = user.phoneNumber;
|
||||
|
||||
this.email = user.email;
|
||||
this.firstName = user.firstName;
|
||||
this.lastName = user.lastName;
|
||||
this.profilePicture = user.profilePicture ? new DocumentMetaResponseDto(user.profilePicture) : null;
|
||||
this.isEmailVerified = user.isEmailVerified;
|
||||
this.isPhoneVerified = user.isPhoneVerified;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user