Updated subscriptions
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user