diff --git a/apps/ecosystem/src/ecosystem.service.ts b/apps/ecosystem/src/ecosystem.service.ts index ddf1f7769..660dd2795 100644 --- a/apps/ecosystem/src/ecosystem.service.ts +++ b/apps/ecosystem/src/ecosystem.service.ts @@ -354,7 +354,7 @@ export class EcosystemService { * @param RequestSchemaEndorsement * @returns */ - async requestSchemaEndorsement(requestSchemaPayload:RequestSchemaEndorsement, orgId: number, ecosystemId: string): Promise { + async requestSchemaEndorsement(requestSchemaPayload: RequestSchemaEndorsement, orgId: number, ecosystemId: string): Promise { try { const getEcosystemLeadDetails = await this.ecosystemRepository.getEcosystemLeadDetails(ecosystemId); @@ -424,7 +424,7 @@ export class EcosystemService { } } - async requestCredDeffEndorsement(requestCredDefPayload:RequestCredDeffEndorsement, orgId:number, ecosystemId:string): Promise { + async requestCredDeffEndorsement(requestCredDefPayload: RequestCredDeffEndorsement, orgId: number, ecosystemId: string): Promise { try { const getEcosystemLeadDetails = await this.ecosystemRepository.getEcosystemLeadDetails(ecosystemId); @@ -477,6 +477,13 @@ export class EcosystemService { throw new InternalServerErrorException(ResponseMessages.ecosystem.error.requestCredDefTransaction); } + const requestBody = credDefTransactionRequest.message.credentialDefinitionState.credentialDefinition; + + if (!requestBody) { + throw new NotFoundException(ResponseMessages.ecosystem.error.credentialDefinitionNotFound); + } + + requestCredDefPayload["credentialDefinition"] = requestBody; const schemaTransactionResponse = { endorserDid: ecosystemLeadAgentDetails.orgDid, authorDid: ecosystemMemberDetails.orgDid,