Skip to content

Commit 1616eee

Browse files
committed
only show active subs for now
1 parent 9706baf commit 1616eee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/clerk-js/src/core/modules/commerce/CommerceBilling.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class __experimental_CommerceBilling implements __experimental_CommerceBi
3737
const { orgId, ...rest } = params;
3838

3939
return await BaseResource._fetch({
40-
path: orgId ? `/organizations/${orgId}/subscriptions` : `/me/subscriptions`,
40+
path: orgId ? `/organizations/${orgId}/subscriptions` : `/me/commerce/subscriptions`,
4141
method: 'GET',
4242
search: convertPageToOffsetSearchParams(rest),
4343
}).then(res => {

packages/clerk-js/src/ui/hooks/usePlans.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const usePlans = (props: UsePlansProps) => {
3232
return (
3333
allPlans?.map(plan => {
3434
const activeSubscription = subscriptions.data.find(sub => {
35-
return sub.plan.id === plan.id;
35+
return sub.plan.id === plan.id && sub.status === 'active';
3636
});
3737
plan.subscriptionIdForCurrentSubscriber = activeSubscription?.id;
3838
return plan;

0 commit comments

Comments
 (0)