Skip to content

Commit

Permalink
feat(backend): Introduce a new getOrganizationInvitation() method
Browse files Browse the repository at this point in the history
Introduce a new getOrganizationInvitation() method on the Organization
resource, which you can use in order to fetch a single organization
invitation by ID
  • Loading branch information
chanioxaris committed Sep 5, 2023
1 parent a523d0c commit e6a3889
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-fishes-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/backend': minor
---

Introduce a new getOrganizationInvitation() method with which you can fetch a single organization invitation by providing the ID
16 changes: 16 additions & 0 deletions packages/backend/src/api/endpoints/OrganizationApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ type GetPendingOrganizationInvitationListParams = {
offset?: number;
};

type GetOrganizationInvitationParams = {
organizationId: string;
invitationId: string;
};

type RevokeOrganizationInvitationParams = {
organizationId: string;
invitationId: string;
Expand Down Expand Up @@ -245,6 +250,17 @@ export class OrganizationAPI extends AbstractAPI {
});
}

public async getOrganizationInvitation(params: GetOrganizationInvitationParams) {
const { organizationId, invitationId } = params;
this.requireId(organizationId);
this.requireId(invitationId);

return this.request<OrganizationInvitation>({
method: 'GET',
path: joinPaths(basePath, organizationId, 'invitations', invitationId),
});
}

public async revokeOrganizationInvitation(params: RevokeOrganizationInvitationParams) {
const { organizationId, invitationId, requestingUserId } = params;
this.requireId(organizationId);
Expand Down

0 comments on commit e6a3889

Please sign in to comment.