/** * IMPORTANT: Backend validation errors MUST be thrown as parsed JSON. * * ❌ DO NOT: throw new Error(JSON.stringify(error)) * ✅ DO THIS: throw errorJson * * This preserves the structure needed for field-level error display. */ export const saveResource = async (...) => { if (!response.ok) { const errorJson = await response.json(); throw errorJson; // 👈 PRESERVES details.validationErrors } return response.json(); }; __ __