@clerk/shared 3.28.3 → 3.28.4-canary.v20251026194813
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apiUrlFromPublishableKey.d.mts +1 -1
- package/dist/apiUrlFromPublishableKey.d.ts +1 -1
- package/dist/{chunk-ELKNO6YM.mjs → chunk-OZEXCWO3.mjs} +3 -3
- package/dist/{chunk-ELKNO6YM.mjs.map → chunk-OZEXCWO3.mjs.map} +1 -1
- package/dist/{chunk-YTPL7FML.mjs → chunk-TQU2CHLC.mjs} +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/loadClerkJsScript.js +2 -2
- package/dist/loadClerkJsScript.js.map +1 -1
- package/dist/loadClerkJsScript.mjs +2 -2
- package/dist/react/index.js +7 -7
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +7 -7
- package/dist/react/index.mjs.map +1 -1
- package/dist/versionSelector.js +2 -2
- package/dist/versionSelector.js.map +1 -1
- package/dist/versionSelector.mjs +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-YTPL7FML.mjs.map → chunk-TQU2CHLC.mjs.map} +0 -0
package/dist/react/index.mjs
CHANGED
|
@@ -765,8 +765,9 @@ function createBillingPaginatedHook({
|
|
|
765
765
|
}) {
|
|
766
766
|
return function useBillingHook(params) {
|
|
767
767
|
const { for: _for, ...paginationParams } = params || {};
|
|
768
|
+
const safeFor = _for || "user";
|
|
768
769
|
useAssertWrappedByClerkProvider(hookName5);
|
|
769
|
-
const fetchFn = useFetcher(
|
|
770
|
+
const fetchFn = useFetcher(safeFor);
|
|
770
771
|
const safeValues = useWithSafeValues(paginationParams, {
|
|
771
772
|
initialPage: 1,
|
|
772
773
|
pageSize: 10,
|
|
@@ -779,13 +780,13 @@ function createBillingPaginatedHook({
|
|
|
779
780
|
const user = useUserContext();
|
|
780
781
|
const { organization } = useOrganizationContext();
|
|
781
782
|
clerk.telemetry?.record(eventMethodCalled(hookName5));
|
|
783
|
+
const isForOrganization = safeFor === "organization";
|
|
782
784
|
const hookParams = typeof paginationParams === "undefined" ? void 0 : {
|
|
783
785
|
initialPage: safeValues.initialPage,
|
|
784
786
|
pageSize: safeValues.pageSize,
|
|
785
|
-
...options?.unauthenticated ? {} :
|
|
787
|
+
...options?.unauthenticated ? {} : isForOrganization ? { orgId: organization?.id } : {}
|
|
786
788
|
};
|
|
787
|
-
const
|
|
788
|
-
const billingEnabled = isOrganization ? environment?.commerceSettings.billing.organization.enabled : environment?.commerceSettings.billing.user.enabled;
|
|
789
|
+
const billingEnabled = isForOrganization ? environment?.commerceSettings.billing.organization.enabled : environment?.commerceSettings.billing.user.enabled;
|
|
789
790
|
const isEnabled = !!hookParams && clerk.loaded && !!billingEnabled;
|
|
790
791
|
const result = usePagesOrInfinite(
|
|
791
792
|
hookParams || {},
|
|
@@ -799,10 +800,9 @@ function createBillingPaginatedHook({
|
|
|
799
800
|
},
|
|
800
801
|
{
|
|
801
802
|
type: resourceType,
|
|
802
|
-
|
|
803
|
-
...options?.unauthenticated ? {} : {
|
|
803
|
+
...options?.unauthenticated ? { for: safeFor } : {
|
|
804
804
|
userId: user?.id,
|
|
805
|
-
...
|
|
805
|
+
...isForOrganization ? { orgId: organization?.id } : {}
|
|
806
806
|
}
|
|
807
807
|
}
|
|
808
808
|
);
|