Files
console/src/lib/helpers/pricingRedirect.ts
T

14 lines
478 B
TypeScript

import { goto } from '$app/navigation';
import { base } from '$app/paths';
export function checkPricingRefAndRedirect(searchParams: URLSearchParams, shouldRegister = false) {
if (searchParams.has('type')) {
const paramType = searchParams.get('type');
if (paramType === 'createPro') {
shouldRegister
? goto(`${base}/register?type=createPro`)
: goto(`${base}/create-organization?type=createPro`);
}
}
}