Skip to content

Commit

Permalink
Merge pull request #595 from credebl/issues-from-api-side
Browse files Browse the repository at this point in the history
fix: delete the ecosystem invitation which is already deleted
  • Loading branch information
pranalidhanavade authored Mar 14, 2024
2 parents 67b2e6a + 9005dbe commit ad3c673
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apps/ecosystem/src/ecosystem.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,18 @@ export class EcosystemRepository {
// eslint-disable-next-line camelcase
async deleteInvitations(invitationId: string): Promise<ecosystem_invitations> {
try {

const findInvitation = await this.prisma.ecosystem_invitations.findUnique({
where: {
id: invitationId,
status: EcosystemInvitationStatus.PENDING
}
});

if (!findInvitation) {
throw new NotFoundException('Ecosystem Invitation not found');
}

const deletedInvitation = await this.prisma.ecosystem_invitations.delete({
where: {
id: invitationId,
Expand Down

0 comments on commit ad3c673

Please sign in to comment.