export async function sendRequest(url, method, body) { const res = await fetch(url, { method, headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) }); if (!res.ok) throw new Error(`Request failed: ${res.status}`); return res.json(); }