iris / frontend /src /api.js
github-actions[bot]
Automated Deploy: 2845ef877db9dd2af4e8ee9da6d857c78ef513f2
b5af7d6
Raw History Blame
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;
}