export async function vconApiFetch(endpoint: string, options?: RequestInit): Promise { const res = await fetch(endpoint, { ...options, headers: { 'Content-Type': 'application/json', ...options?.headers, }, }); if (!res.ok) { const errorBody = await res.json().catch(() => ({})); throw new Error(errorBody.error || `API error ${res.status}: ${res.statusText}`); } return res.json(); }