fix: ClosedCases — apiFetch возвращает Response, а не JSON (архив всегда показывал 0)

- Загрузка списка, создание и удаление переведены на apiJson
  (apiFetch → Response.items === undefined → items=[]).
This commit is contained in:
2026-09-09 21:58:39 +03:00
parent 5a86755e90
commit 611ca95d3a
+2 -3
View File
@@ -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);