Skip to content

Commit

Permalink
fix: 🐛 Add missing IsOptional to securityIdentifiers
Browse files Browse the repository at this point in the history
This adds in `IsOptional` annotation to `securityIdentifiers` in
`CreateAssetDto` and `CreateNftCollectionDto`
  • Loading branch information
prashantasdeveloper committed Nov 26, 2024
1 parent 89f96d0 commit 49378b1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/assets/dto/create-asset.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export class CreateAssetDto extends TransactionBaseDto {
isArray: true,
type: SecurityIdentifierDto,
})
@IsOptional()
@ValidateNested({ each: true })
@Type(() => SecurityIdentifierDto)
readonly securityIdentifiers?: SecurityIdentifierDto[];
Expand Down
10 changes: 9 additions & 1 deletion src/compliance/dto/condition.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -38,6 +45,7 @@ export class ConditionDto {
})
@ValidateNested({ each: true })
@Type(() => TrustedClaimIssuerDto)
@IsOptional()
readonly trustedClaimIssuers?: TrustedClaimIssuerDto[];

@ApiPropertyOptional({
Expand Down
1 change: 1 addition & 0 deletions src/nfts/dto/create-nft-collection.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class CreateNftCollectionDto extends TransactionBaseDto {
isArray: true,
type: SecurityIdentifierDto,
})
@IsOptional()
@ValidateNested({ each: true })
@Type(() => SecurityIdentifierDto)
readonly securityIdentifiers?: SecurityIdentifierDto[];
Expand Down

0 comments on commit 49378b1

Please sign in to comment.