Updated subscriptions

This commit is contained in:
KS Jannette
2026-05-12 17:39:42 -04:00
parent 2ab6dd0d6a
commit f086ef98ff
13 changed files with 386 additions and 78 deletions

View File

@@ -1,12 +1,12 @@
import { getAuthHeaders } from "./authHeaders";
import { API_BASE } from "./config";
export async function createCheckoutSession(tier = "premium") {
export async function createCheckoutSession(tier = "premium", interval = "annual") {
const headers = await getAuthHeaders();
const res = await fetch(`${API_BASE}/stripe/create-checkout-session`, {
method: "POST",
headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({ tier }),
body: JSON.stringify({ tier, interval }),
});
if (!res.ok) {
const data = await res.json();