Skip to content

Commit

Permalink
fix: fix wallet spinup dto issue (#675)
Browse files Browse the repository at this point in the history
Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>
Signed-off-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>
  • Loading branch information
tipusinghaw authored and KulkarniShashank committed Sep 11, 2024
1 parent a75ccd1 commit 6b1b883
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import { CustomExceptionFilter } from 'apps/api-gateway/common/exception-handler
import { Roles } from '../authz/decorators/roles.decorator';
import { OrgRoles } from 'libs/org-roles/enums';
import { OrgRolesGuard } from '../authz/guards/org-roles.guard';
import { CreateDidDto } from './dto/create-did.dto';
import { validateDid } from '@credebl/common/did.validator';
import { CreateWalletDto } from './dto/create-wallet.dto';
import { CreateNewDidDto } from './dto/create-new-did.dto';

const seedLength = 32;

Expand Down Expand Up @@ -232,7 +232,7 @@ export class AgentController {
@ApiResponse({ status: HttpStatus.CREATED, description: 'Success', type: ApiResponseDto })
async createDid(
@Param('orgId') orgId: string,
@Body() createDidDto: CreateDidDto,
@Body() createDidDto: CreateNewDidDto,
@User() user: user,
@Res() res: Response
): Promise<Response> {
Expand Down
7 changes: 1 addition & 6 deletions apps/api-gateway/src/agent-service/dto/create-did.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, Matches, IsNotEmpty, IsOptional, IsBoolean } from 'class-validator';
import { MaxLength, IsString, Matches, IsNotEmpty, IsOptional } from 'class-validator';

export class CreateDidDto {

Expand Down Expand Up @@ -75,9 +75,4 @@ export class CreateDidDto {
@Transform(({ value }) => trim(value))
@IsString({ message: 'endorser did must be in string format.' })
endorserDid?: string;

@ApiProperty({example: false})
@ApiPropertyOptional()
@IsBoolean({ message: 'isPrimaryDid did must be true or false.' })
isPrimaryDid: boolean = false;
}
9 changes: 9 additions & 0 deletions apps/api-gateway/src/agent-service/dto/create-new-did.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsBoolean } from 'class-validator';
import { CreateDidDto } from './create-did.dto';
export class CreateNewDidDto extends CreateDidDto {
@ApiProperty({example: false})
@ApiPropertyOptional()
@IsBoolean({ message: 'isPrimaryDid did must be true or false.' })
isPrimaryDid: boolean = false;
}

0 comments on commit 6b1b883

Please sign in to comment.