From 611ca95d3ab2b5228575373df7237926924a6948 Mon Sep 17 00:00:00 2001 From: viktot14-ai Date: Wed, 9 Sep 2026 21:58:39 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20ClosedCases=20=E2=80=94=20apiFetch=20?= =?UTF-8?q?=D0=B2=D0=BE=D0=B7=D0=B2=D1=80=D0=B0=D1=89=D0=B0=D0=B5=D1=82=20?= =?UTF-8?q?Response,=20=D0=B0=20=D0=BD=D0=B5=20JSON=20(=D0=B0=D1=80=D1=85?= =?UTF-8?q?=D0=B8=D0=B2=20=D0=B2=D1=81=D0=B5=D0=B3=D0=B4=D0=B0=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BA=D0=B0=D0=B7=D1=8B=D0=B2=D0=B0=D0=BB=200)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Загрузка списка, создание и удаление переведены на apiJson (apiFetch → Response.items === undefined → items=[]). --- frontend/src/pages/ClosedCases.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/ClosedCases.jsx b/frontend/src/pages/ClosedCases.jsx index 7e888ef..7d3c35f 100644 --- a/frontend/src/pages/ClosedCases.jsx +++ b/frontend/src/pages/ClosedCases.jsx @@ -138,9 +138,8 @@ export default function ClosedCases() { } setSaving(true); try { - const created = await apiFetch('/api/v1/closed-cases', { + const created = await apiJson('/api/v1/closed-cases', { method: 'POST', - headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(CleanForm(form)), }); setLastPrediction(created); @@ -156,7 +155,7 @@ export default function ClosedCases() { const remove = async (id) => { if (!window.confirm('Удалить запись?')) return; try { - await apiFetch(`/api/v1/closed-cases/${id}`, { method: 'DELETE' }); + await apiJson(`/api/v1/closed-cases/${id}`, { method: 'DELETE' }); await load(); } catch (e) { setError(e.message);