diff --git a/packages/clerk-js/src/core/resources/Organization.ts b/packages/clerk-js/src/core/resources/Organization.ts index 8af29aa6355..c60077d46f9 100644 --- a/packages/clerk-js/src/core/resources/Organization.ts +++ b/packages/clerk-js/src/core/resources/Organization.ts @@ -1,3 +1,4 @@ +import { deprecated } from '@clerk/shared'; import type { AddMemberParams, ClerkPaginatedResponse, @@ -195,6 +196,7 @@ export class Organization extends BaseResource implements OrganizationResource { getPendingInvitations = async ( getPendingInvitationsParams?: GetPendingInvitationsParams, ): Promise => { + deprecated('getPendingInvitations', 'Use the `getInvitations` method instead.'); return await BaseResource._fetch({ path: `/organizations/${this.id}/invitations/pending`, method: 'GET', diff --git a/packages/shared/src/hooks/useOrganization.tsx b/packages/shared/src/hooks/useOrganization.tsx index 15e75b5a8eb..d8354846813 100644 --- a/packages/shared/src/hooks/useOrganization.tsx +++ b/packages/shared/src/hooks/useOrganization.tsx @@ -21,6 +21,7 @@ import { useSWR } from './clerk-swr'; import { useClerkInstanceContext, useOrganizationContext, useSessionContext } from './contexts'; import type { PaginatedResources, PaginatedResourcesWithDefault } from './types'; import { usePagesOrInfinite, useWithSafeValues } from './usePagesOrInfinite'; +import { deprecated } from '../utils'; type UseOrganizationParams = { /** @@ -290,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.'); + } + const { data: invitationList, isValidating: isInvitationsLoading, @@ -301,6 +306,10 @@ export const useOrganization: UseOrganization = params => { pendingInvitations, ); + if (membershipListParams) { + deprecated('membershipList in useOrganization', 'Use the `memberships` property and return value instead.'); + } + const { data: membershipList, isValidating: isMembershipsLoading,