Skip to content

Commit

Permalink
Merge pull request #474 from credebl/refactor-delete-invitation-api
Browse files Browse the repository at this point in the history
fix: Delete ecosystem invitations API
  • Loading branch information
vivekayanworks authored Jan 31, 2024
2 parents 5e30fb8 + 50f5fed commit fbc8a7a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 6 additions & 5 deletions apps/api-gateway/src/ecosystem/ecosystem.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ export class EcosystemController {

@Delete('/:ecosystemId/:orgId/invitations/:invitationId')
@ApiOperation({ summary: 'Delete ecosystem pending invitations', description: 'Delete ecosystem pending invitations' })
@ApiResponse({ status: 200, description: 'Success', type: ApiResponseDto })
@ApiResponse({ status: HttpStatus.OK, description: 'Success', type: ApiResponseDto })
@UseGuards(AuthGuard('jwt'), EcosystemRolesGuard, OrgRolesGuard)
@EcosystemsRoles(EcosystemRoles.ECOSYSTEM_OWNER, EcosystemRoles.ECOSYSTEM_LEAD)
@Roles(OrgRoles.OWNER)
Expand All @@ -554,12 +554,13 @@ export class EcosystemController {
@Param('orgId') orgId: string,
@Res() res: Response): Promise<Response> {

await this.ecosystemService.deleteEcosystemInvitations(invitationId);
const deletedEcosystemInvitationResponse = await this.ecosystemService.deleteEcosystemInvitations(invitationId);
const finalResponse: IResponse = {
statusCode: 200,
message: ResponseMessages.ecosystem.success.delete
statusCode: HttpStatus.OK,
message: ResponseMessages.ecosystem.success.delete,
data:deletedEcosystemInvitationResponse
};
return res.status(200).json(finalResponse);
return res.status(HttpStatus.OK).json(finalResponse);
}


Expand Down
3 changes: 3 additions & 0 deletions apps/ecosystem/src/ecosystem.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,9 @@ async findEcosystemMembers(
status: EcosystemInvitationStatus.PENDING
}
});

delete deletedInvitation.lastChangedBy;
delete deletedInvitation.lastChangedDateTime;
return deletedInvitation;
} catch (error) {
this.logger.error(`error: ${JSON.stringify(error)}`);
Expand Down

0 comments on commit fbc8a7a

Please sign in to comment.