fix: invalidate orders list after deleting an order

The kanban board kept showing deleted orders until manual reload.
Added qc.invalidateQueries for 'orders' and qc.removeQueries for
the deleted order's detail cache on delete success.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 20:49:46 +01:00
parent 6f7c001376
commit c82f2a894d
+2
View File
@@ -102,6 +102,8 @@ export default function OrderDetailPage() {
mutationFn: () => deleteOrder(id!),
onSuccess: () => {
toast.success('Order deleted')
qc.invalidateQueries({ queryKey: ['orders'] })
qc.removeQueries({ queryKey: ['order', id] })
navigate('/orders')
},
onError: (e: any) => toast.error(e.response?.data?.detail || 'Delete failed'),