fix(tickets): refresh status and resources in detail panel after update
Some checks failed
Mirror to GitHub / mirror (push) Successful in 3s
CI / backend (pull_request) Failing after 17m32s
CI / frontend (pull_request) Failing after 48s
CI / e2e (pull_request) Has been skipped

Status update was returning only new_status (string) and the parent list's
onStatusUpdated only set status_name. The <select> was bound to status_id,
which never changed — so it visually reverted to the old status even though
the PATCH succeeded.

- Backend: include new_status_id in the status-update response.
- Panel: own currentStatusId/currentStatusName state so the select reflects
  the change immediately and survives stale parent snapshots.
- Parent list: update status_id on both the row and selectedTicket so the
  list row stays in sync when the panel stays open.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-16 21:28:48 +00:00
parent 60851b400a
commit 04ff2ea301
6 changed files with 33 additions and 11 deletions

View File

@@ -231,10 +231,15 @@ export default function TicketsPage() {
<TicketDetailPanel
ticket={selectedTicket}
onClose={() => setSelectedTicket(null)}
onStatusUpdated={(ticketId, newStatus) => {
onStatusUpdated={(ticketId, newStatus, newStatusId) => {
setTickets(prev => prev.map(t =>
t.id === String(ticketId) ? { ...t, status_name: newStatus } : t
t.id === String(ticketId) ? { ...t, status_name: newStatus, status_id: newStatusId } : t
))
setSelectedTicket(prev =>
prev && prev.id === String(ticketId)
? { ...prev, status_name: newStatus, status_id: newStatusId }
: prev
)
}}
/>
</div>