I have this UpdateAccountDto
export class UpdateAccountDto {
@ApiPropertyOptional()
@IsOptional()
roles: string[];
@ApiPropertyOptional()
@IsOptional()
managers: string[];
@ApiPropertyOptional()
@IsOptional()
@IsBoolean()
status: boolean;
@ApiPropertyOptional()
@IsString()
@IsOptional()
locale: string;
}
I want to use this DTO to make an update request as admin and user. If admin makes request, accept all above fields to be updated If user makes request, only accept locale to be updated (not roles, managers, or status)
Is there any good way to do this?
Currently I have to make 2 DTOs and 2 services, one for admin and one for user. So I'm trying to find a way to reuse from 1 DTO & 1 service
Thank you in advance!