Skip to content

Commit

Permalink
Merge pull request #561 from credebl/agent-ledger-id
Browse files Browse the repository at this point in the history
fix: ledger id validations
  • Loading branch information
KulkarniShashank authored Mar 1, 2024
2 parents 2192458 + 19f9dcc commit 4f20455
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/api-gateway/src/agent-service/dto/create-tenant.dto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { trim } from '@credebl/common/cast.helper';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
import { MaxLength, IsString, MinLength, Matches, IsNotEmpty, IsOptional, IsArray } from 'class-validator';
import { MaxLength, IsString, MinLength, Matches, IsNotEmpty, IsOptional, IsArray, IsUUID } from 'class-validator';
const labelRegex = /^[a-zA-Z0-9 ]*$/;
export class CreateTenantDto {
@ApiProperty()
Expand All @@ -28,6 +28,7 @@ export class CreateTenantDto {
@ApiProperty({ example: ["b942473d-6fdd-4a38-b76e-a3314fca66b6"] })
@ApiPropertyOptional()
@IsOptional()
@IsUUID(4, {each:true, message: "Please provide valid ledgerId"})
@IsArray({ message: 'ledgerId must be an array' })
@IsNotEmpty({ message: 'please provide valid ledgerId' })
@IsString({ each: true, message: 'Each ledgerId must be a string' })
Expand Down

0 comments on commit 4f20455

Please sign in to comment.