fix(tickets): refresh status and resources in detail panel after update
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user