-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New getInvitations
in clerk-js and invitations
from useOrganization
#1766
Conversation
🦋 Changeset detectedLatest commit: 27448be The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
data: requests.map(request => new OrganizationInvitation(request)), | ||
}; | ||
}) | ||
.catch(() => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔧 Catching the error at this point prevents the global error handler of the FAPI client to kick-in. Is there a specific reason we want to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we used it previously for any method that was fetching arrays
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I am not sure if it's correct thought. We should the error bubble up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't be breaking change to change it now ? Shall we aim to fix for v5 ?
} | ||
| { | ||
isLoaded: boolean; | ||
organization: OrganizationResource | null; | ||
/** | ||
* @deprecated Use `invitations` instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dimkl Introduced a deprecated utility function that logs a deprecation message for our customers. You should use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on it
8278439
to
1f64b5b
Compare
1f64b5b
to
1fab907
Compare
… `getPendingInvitations`
…from useOrganization
1fab907
to
27448be
Compare
data: requests.map(request => new OrganizationInvitation(request)), | ||
}; | ||
}) | ||
.catch(() => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I am not sure if it's correct thought. We should the error bubble up.
@@ -232,6 +291,10 @@ export const useOrganization: UseOrganization = params => { | |||
? () => [] as OrganizationMembershipResource[] | |||
: () => clerk.organization?.getMemberships(membershipListParams); | |||
|
|||
if (invitationListParams) { | |||
deprecated('invitationList in useOrganization', 'Use the `invitations` property and return value instead.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
This PR has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
This PR
getPendingInvitations
which did not allow for filtering by statusgetInvitations
which support the new pagination params and filteringinvitationList
as params and return value of useOrganizationinvitations
which support paginated responces, build-in pagination, and infinite loading.It was the missing part that brings our organization hooks in harmony between their APIs
Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change
Packages affected
@clerk/clerk-js
@clerk/clerk-react
@clerk/nextjs
@clerk/remix
@clerk/types
@clerk/themes
@clerk/localizations
@clerk/clerk-expo
@clerk/backend
@clerk/clerk-sdk-node
@clerk/shared
@clerk/fastify
@clerk/chrome-extension
gatsby-plugin-clerk
build/tooling/chore