Skip to content

Commit 9b9ce01

Browse files
committed
fix(billing): keep the fetched subscription's referenceId for the org-scope check
1 parent b7111b2 commit 9b9ce01

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎apps/sim/lib/billing/usage-upgrade.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ export async function resolveUsageUpgradePayload(
5252
subscription = payer.payerSubscription
5353
orgScoped = payer.billingEntity.type === 'organization'
5454
} else {
55-
subscription = await getHighestPrioritySubscription(userId)
56-
orgScoped = isOrgScopedSubscription(subscription, userId)
55+
const current = await getHighestPrioritySubscription(userId)
56+
subscription = current
57+
orgScoped = isOrgScopedSubscription(current, userId)
5758
}
5859
} catch (error) {
5960
logger.warn('Failed to determine subscription plan, defaulting to upgrade_plan', {

0 commit comments

Comments
 (0)