CreateAdminDto.ts
export class CreateAdminDto {
readonly username!: string;
@IsOptional()
readonly jurisdiction?: string | null = null;
@IsOptional()
readonly nickname?: string;
}
UpdateAdminDto.ts
export class UpdateAdminDto extends PartialType(OmitType(CreateAdminDto, ['username'])) {}
In CreateAdminDto, I defined a jurisdiction
attribute and set the default value. In UpdateAdminDto, I used @nestjs/swagger PartialType
function, and when I update, I don’t pass the jurisdiction
attribute, but it does have a default value. How do I remove this default value?