Skip to content

Commit

Permalink
fix(clerk-js,shared): Refresh invited members upon revocation (#2058)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmilewski authored Nov 7, 2023
1 parent 034abeb commit 59336d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/thirty-doors-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Refresh invited members upon revocation
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const ActiveMembersList = () => {
.catch(err => handleError(err, [], card.setError));
};

const handleRemove = (membership: OrganizationMembershipResource) => () => {
const handleRemove = (membership: OrganizationMembershipResource) => async () => {
return card
.runAsync(async () => {
const destroyedMembership = await membership.destroy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ export const InvitedMembersList = () => {
return null;
}

const revoke = (invitation: OrganizationInvitationResource) => () => {
const revoke = (invitation: OrganizationInvitationResource) => async () => {
return card
.runAsync(async () => {
await invitation.revoke();
await (invitations as any).unstable__mutate?.();
await invitations?.revalidate?.();
return invitation;
})
.catch(err => handleError(err, [], card.setError));
};
Expand Down

0 comments on commit 59336d3

Please sign in to comment.