fix: task delete → cancel (status=cancelled) instead of hard delete

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 <noreply@anthropic.com>
This commit is contained in:
2026-03-24 12:02:18 +03:00
parent aeef924542
commit 651afcff94

View File

@@ -90,10 +90,10 @@ export function TechnicalPage() {
} }
const handleDelete = async (taskId: string) => { const handleDelete = async (taskId: string) => {
if (!confirm('Удалить задачу?')) return if (!confirm('Отменить задачу? Она останется в истории со статусом «Отменено».')) return
try { try {
await api.housekeeping.delete(slug, taskId) const updated = await api.housekeeping.update(slug, taskId, { status: 'cancelled' })
setTasks(prev => prev.filter(t => t.id !== taskId)) setTasks(prev => prev.map(t => t.id === taskId ? updated : t))
} catch (err) { } catch (err) {
console.error(err) console.error(err)
} }