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:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user