Skip to content

Commit

Permalink
feat(types,clerk-js): Introduce UserOrganizationInvitation.accept()
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef committed Aug 4, 2023
1 parent 89bc5de commit 8873841
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/green-rocks-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@clerk/clerk-js': patch
'@clerk/types': patch
---

Introduces the accept method in UserOrganizationInvitation class
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ export class UserOrganizationInvitation extends BaseResource implements UserOrga
super();
this.fromJSON(data);
}

accept = async (): Promise<UserOrganizationInvitation> => {
return await this._basePost({
path: `/me/organization_invitations/${this.id}/accept`,
});
};

protected fromJSON(data: UserOrganizationInvitationJSON | null): this {
if (data) {
this.id = data.id;
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/userOrganizationInvitation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ export interface UserOrganizationInvitationResource extends ClerkResource {
status: OrganizationInvitationStatus;
createdAt: Date;
updatedAt: Date;
accept: () => Promise<UserOrganizationInvitationResource>;
}

0 comments on commit 8873841

Please sign in to comment.