diff --git a/src/routes/(console)/+layout.ts b/src/routes/(console)/+layout.ts index 1f5bbfc3e..0521240c1 100644 --- a/src/routes/(console)/+layout.ts +++ b/src/routes/(console)/+layout.ts @@ -25,6 +25,7 @@ export const load: LayoutLoad = async ({ fetch, depends, parent }) => { let plansInfo = new Map(); if (isCloud) { const plansArray = await sdk.forConsole.billing.getPlansInfo(); + console.log('plansArray', plansArray); plansInfo = plansArray.plans.reduce((map, plan) => { map.set(plan.$id as Tier, plan); return map; diff --git a/src/routes/(console)/apply-credit/+page.svelte b/src/routes/(console)/apply-credit/+page.svelte index df8a16bf9..95af6175f 100644 --- a/src/routes/(console)/apply-credit/+page.svelte +++ b/src/routes/(console)/apply-credit/+page.svelte @@ -190,11 +190,10 @@ (team) => team.$id === selectedOrgId ) as Organization; - $: if (selectedOrg?.billingPlan === BillingPlan.SCALE) { - billingPlan = BillingPlan.SCALE; - } else if (campaign?.plan) { - billingPlan = campaign.plan; - } + $: billingPlan = + selectedOrg?.billingPlan === BillingPlan.SCALE + ? BillingPlan.SCALE + : (campaign?.plan ?? BillingPlan.PRO);