fix: redirect

This commit is contained in:
Arman
2025-01-23 12:29:31 +01:00
parent 4c504de9b4
commit f712ec5ea8
2 changed files with 13 additions and 9 deletions
+13 -2
View File
@@ -4,10 +4,21 @@ import { base } from '$app/paths';
export function checkPricingRefAndRedirect(searchParams: URLSearchParams, shouldRegister = false) {
if (searchParams.has('type')) {
const paramType = searchParams.get('type');
const hasPlan = searchParams.has('plan');
if (paramType === 'create') {
shouldRegister
? goto(
`${base}/register?type=create${hasPlan ? `&plan=${searchParams.get('plan')}` : ''}`
)
: goto(
`${base}/create-organization?type=create${hasPlan ? `&plan=${searchParams.get('plan')}` : ''}`
);
}
//Legacy
if (paramType === 'createPro') {
shouldRegister
? goto(`${base}/register?type=createPro`)
: goto(`${base}/create-organization?type=createPro`);
? goto(`${base}/register?type=create&plan=tier-1`)
: goto(`${base}/create-organization?type=create&plan=tier-1`);
}
}
}
@@ -79,13 +79,6 @@
billingPlan = plan as BillingPlan;
}
}
if (
anyOrgFree ||
($page.url.searchParams.has('type') &&
$page.url.searchParams.get('type') === 'createPro')
) {
billingPlan = BillingPlan.PRO;
}
});
async function loadPaymentMethods() {