From 49378b16060f9fcb235bfdef32bc9f748122d777 Mon Sep 17 00:00:00 2001 From: Prashant Bajpai <34747455+prashantasdeveloper@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:11:18 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Add=20missing=20`IsOption?= =?UTF-8?q?al`=20to=20`securityIdentifiers`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds in `IsOptional` annotation to `securityIdentifiers` in `CreateAssetDto` and `CreateNftCollectionDto` --- src/assets/dto/create-asset.dto.ts | 1 + src/compliance/dto/condition.dto.ts | 10 +++++++++- src/nfts/dto/create-nft-collection.dto.ts | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/assets/dto/create-asset.dto.ts b/src/assets/dto/create-asset.dto.ts index 614d9852..4861d56b 100644 --- a/src/assets/dto/create-asset.dto.ts +++ b/src/assets/dto/create-asset.dto.ts @@ -59,6 +59,7 @@ export class CreateAssetDto extends TransactionBaseDto { isArray: true, type: SecurityIdentifierDto, }) + @IsOptional() @ValidateNested({ each: true }) @Type(() => SecurityIdentifierDto) readonly securityIdentifiers?: SecurityIdentifierDto[]; diff --git a/src/compliance/dto/condition.dto.ts b/src/compliance/dto/condition.dto.ts index 06b2c7b5..f34c13ee 100644 --- a/src/compliance/dto/condition.dto.ts +++ b/src/compliance/dto/condition.dto.ts @@ -7,7 +7,14 @@ import { isSingleClaimCondition, } from '@polymeshassociation/polymesh-sdk/utils'; import { Type } from 'class-transformer'; -import { IsEnum, IsNotEmpty, IsNotEmptyObject, ValidateIf, ValidateNested } from 'class-validator'; +import { + IsEnum, + IsNotEmpty, + IsNotEmptyObject, + IsOptional, + ValidateIf, + ValidateNested, +} from 'class-validator'; import { ClaimDto } from '~/claims/dto/claim.dto'; import { IsDid } from '~/common/decorators/validation'; @@ -38,6 +45,7 @@ export class ConditionDto { }) @ValidateNested({ each: true }) @Type(() => TrustedClaimIssuerDto) + @IsOptional() readonly trustedClaimIssuers?: TrustedClaimIssuerDto[]; @ApiPropertyOptional({ diff --git a/src/nfts/dto/create-nft-collection.dto.ts b/src/nfts/dto/create-nft-collection.dto.ts index 09920b3e..4d29ea1f 100644 --- a/src/nfts/dto/create-nft-collection.dto.ts +++ b/src/nfts/dto/create-nft-collection.dto.ts @@ -40,6 +40,7 @@ export class CreateNftCollectionDto extends TransactionBaseDto { isArray: true, type: SecurityIdentifierDto, }) + @IsOptional() @ValidateNested({ each: true }) @Type(() => SecurityIdentifierDto) readonly securityIdentifiers?: SecurityIdentifierDto[];