Chockfull

This commit is contained in:
KS Jannette
2026-03-28 11:10:25 -04:00
parent 288092e4b4
commit 615dd1dddc
6 changed files with 178 additions and 70 deletions

View File

@@ -15,6 +15,19 @@ export async function createCheckoutSession(tier = "premium") {
return res.json();
}
export async function createOnboardingCheckout(email, tier = "premium") {
const res = await fetch(`${API_BASE}/stripe/create-onboarding-checkout`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ email, tier }),
});
if (!res.ok) {
const data = await res.json();
throw new Error(data.message || "Failed to create checkout session");
}
return res.json();
}
export async function activateFreeTier() {
const headers = await getAuthHeaders();
const res = await fetch(`${API_BASE}/stripe/activate-free`, {