github-actions[bot]
Automated Deploy: f334c0ad60590803e1c813b87a0f019dd5fbaedd
1d21e88
Raw History Blame Contribute Delete
484 Bytes
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;
}