diff --git a/backend/core/src/listings/dto/listing-published-create.dto.ts b/backend/core/src/listings/dto/listing-published-create.dto.ts index 9f085e3951..70240aa699 100644 --- a/backend/core/src/listings/dto/listing-published-create.dto.ts +++ b/backend/core/src/listings/dto/listing-published-create.dto.ts @@ -14,6 +14,7 @@ import { ValidateNested, IsBoolean, IsPhoneNumber, + IsOptional, } from "class-validator" import { ValidationsGroupsEnum } from "../../shared/types/validations-groups-enum" import { OmitType } from "@nestjs/swagger" @@ -102,7 +103,8 @@ export class ListingPublishedCreateDto extends OmitType(ListingCreateDto, [ @Expose() @IsBoolean({ groups: [ValidationsGroupsEnum.default] }) - referralOpportunity: boolean + @IsOptional({ groups: [ValidationsGroupsEnum.default] }) + referralOpportunity?: boolean @Expose() @IsString({ groups: [ValidationsGroupsEnum.default] }) diff --git a/backend/core/src/listings/dto/listing-published-update.dto.ts b/backend/core/src/listings/dto/listing-published-update.dto.ts index 93209c8286..ac6dd81311 100644 --- a/backend/core/src/listings/dto/listing-published-update.dto.ts +++ b/backend/core/src/listings/dto/listing-published-update.dto.ts @@ -11,6 +11,7 @@ import { ValidateNested, IsBoolean, IsPhoneNumber, + IsOptional, } from "class-validator" import { ValidationsGroupsEnum } from "../../shared/types/validations-groups-enum" import { ListingUpdateDto } from "./listing-update.dto" @@ -102,7 +103,8 @@ export class ListingPublishedUpdateDto extends OmitType(ListingUpdateDto, [ @Expose() @IsBoolean({ groups: [ValidationsGroupsEnum.default] }) - referralOpportunity: boolean + @IsOptional({ groups: [ValidationsGroupsEnum.default] }) + referralOpportunity?: boolean @Expose() @IsString({ groups: [ValidationsGroupsEnum.default] })