From 651afcff949ea7c756e57ebbb9fb671ae5ef29a5 Mon Sep 17 00:00:00 2001 From: HotelSync Date: Tue, 24 Mar 2026 12:02:18 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20task=20delete=20=E2=86=92=20cancel=20(st?= =?UTF-8?q?atus=3Dcancelled)=20instead=20of=20hard=20delete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tasks now get status 'cancelled' when deleted — they remain in history. Confirmation dialog updated to reflect this behaviour. Co-Authored-By: Claude Sonnet 4.6 --- src/pages/TechnicalPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/TechnicalPage.tsx b/src/pages/TechnicalPage.tsx index c5e078e..acabfb9 100644 --- a/src/pages/TechnicalPage.tsx +++ b/src/pages/TechnicalPage.tsx @@ -90,10 +90,10 @@ export function TechnicalPage() { } const handleDelete = async (taskId: string) => { - if (!confirm('Удалить задачу?')) return + if (!confirm('Отменить задачу? Она останется в истории со статусом «Отменено».')) return try { - await api.housekeeping.delete(slug, taskId) - setTasks(prev => prev.filter(t => t.id !== taskId)) + const updated = await api.housekeeping.update(slug, taskId, { status: 'cancelled' }) + setTasks(prev => prev.map(t => t.id === taskId ? updated : t)) } catch (err) { console.error(err) }