Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`,
Comment thread
dimkl marked this conversation as resolved.
});
};

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>;
}