ortegarod's picture
Use Docker Studio UI for AMD Space
a1ddd34
raw
history blame contribute delete
397 Bytes
const API_BASE = "";
async function apiFetch(path: string, init?: RequestInit) {
const res = await fetch(`${API_BASE}${path}`, init);
if (!res.ok) {
const text = await res.text().catch(() => "");
throw new Error(`${res.status}: ${text}`);
}
return res.json();
}
export async function getListing(): Promise<{ images: any[]; total: number }> {
return apiFetch("/api/listing");
}