Create monorepo from known-good production state

This commit is contained in:
makearmy 2026-07-09 21:07:34 -04:00
commit c034824338
651 changed files with 120469 additions and 0 deletions

View file

@ -0,0 +1,12 @@
// components/utilities/buying-guide/dx.ts
export type Q = Record<string, any>;
export async function dxGet<T>(path: string, query?: Q): Promise<T> {
const qs = query ? "?" + new URLSearchParams(Object.entries(query).flatMap(([k, v]) =>
Array.isArray(v) ? v.map(x => [k, String(x)]) : [[k, String(v)]]
)).toString() : "";
const res = await fetch(`/api/dx/${path}${qs}`, { credentials: "include" });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const json = await res.json();
return json?.data ?? json;
}