export async function requestPasswordReset(email: string): Promise { const res = await fetch(`http://localhost:8000/protected/reset?${new URLSearchParams({ email })}`, { method: "POST", credentials: "include", }); if (!res.ok) { const body = await res.json().catch(() => null); throw new Error(typeof body?.detail === "string" ? body.detail : "Не удалось отправить запрос"); } }