Skip to content

Commit

Permalink
fix: set primary did issue (#691)
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 accc8c7 commit 6871a2a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion apps/agent-service/src/agent-service.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,20 @@ export class AgentServiceService {

this.notifyClientSocket('agent-spinup-process-completed', payload.clientSocketId);

await this.agentServiceRepository.storeOrgAgentDetails(storeOrgAgentData);
const orgAgentDetails = await this.agentServiceRepository.storeOrgAgentDetails(storeOrgAgentData);

const createdDidDetails = {
orgId: payload.orgId,
did: tenantDetails.DIDCreationOption.did,
didDocument: tenantDetails.DIDCreationOption.didDocument || tenantDetails.DIDCreationOption.didDoc,
isPrimaryDid: true,
orgAgentId: orgAgentDetails.id,
userId: user.id
};

await this.agentServiceRepository.storeDidDetails(createdDidDetails);


this.notifyClientSocket('invitation-url-creation-started', payload.clientSocketId);

// Create the legacy connection invitation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export class OrganizationController {
* @returns success message
*/

@Post('/:orgId/primary-did')
@Put('/:orgId/primary-did')
@Roles(OrgRoles.OWNER, OrgRoles.ADMIN, OrgRoles.ISSUER, OrgRoles.VERIFIER, OrgRoles.MEMBER)
@ApiOperation({ summary: 'Set primary DID', description: 'Set primary DID for an organization' })
@ApiResponse({ status: HttpStatus.CREATED, description: 'Success', type: ApiResponseDto })
Expand Down

0 comments on commit 6871a2a

Please sign in to comment.