fixed login session for user name, and updated the api calls on the product detials pages.
CI / test (push) Successful in 6s

This commit is contained in:
2026-01-25 20:20:48 -05:00
parent 3aee0e6755
commit b09ccc542e
13 changed files with 256 additions and 21 deletions
+10 -4
View File
@@ -58,9 +58,12 @@ export async function fetchProducts(params: {
if (sort) sp.set("sort", sort);
const url = `${API_BASE_URL}/api/v1/products?${sp.toString()}`;
const url = `/api/catalog/products?${sp.toString()}`;
const res = await fetch(url, { cache: "no-store" });
const res = await fetch(url, {
cache: "no-store",
credentials: 'include',
});
if (!res.ok) throw new Error(`Failed to load products (${res.status})`);
const data = (await res.json()) as ProductListItem[];
@@ -83,10 +86,13 @@ export async function fetchProductById(params: {
const { id, platform } = params;
const url =
`${API_BASE_URL}/api/v1/products/${encodeURIComponent(id)}` +
`/api/catalog/products/${encodeURIComponent(id)}` +
(platform ? `?${new URLSearchParams({ platform })}` : "");
const res = await fetch(url, { cache: "no-store" });
const res = await fetch(url, {
cache: "no-store",
credentials: 'include',
});
if (!res.ok) throw new Error(`Failed to load product (${res.status})`);
return (await res.json()) as ProductDetail;
}