export async function requestAlignment(data) { const response = await fetch('/api/register', {method: 'POST', body: data}); const body = await response.json().catch(() => null); if (!response.ok) { throw new Error(typeof body?.detail === 'string' ? body.detail : `The request could not be completed (${response.status}). Please retry.`); } if (!body?.images || !body?.metrics) throw new Error('The server returned an incomplete review. Please retry.'); return body; }