fix(tickets): send priority_id on New Ticket create (was dropped silently) #185

Merged
YousifShkara merged 1 commit from fix/pms-358-ticket-priority-not-sent into main 2026-06-16 06:26:27 +02:00
Owner

The New Ticket form had a Priority Select wired to a priority signal initialized to "medium", but the submit handler never read it - the POST body only carried title, description, company_id. Every ticket created via the form fell through to the tenant's default priority server-side, which is almost always Medium regardless of what the user picked. Reviewer (Claude for Chrome) reproduced: selecting High persists Medium on detail, list, dashboard, and the Open Tickets by Priority widget.

Doubly wrong because the server's CreateTicketRequest takes priority_id: Option, not a string name. Even if the submit handler had read the signal, sending "medium" as priority_id would have been silently coerced to None.

Fix lands the proper lookup: the form fetches GET /tickets/priorities on mount (paginated lookup the server has had all along), seeds the signal with whichever row carries is_default = true (or the first row), renders the Select with each priority's UUID as the option value and its name as the label, and serialises the chosen UUID as priority_id in the POST body. Empty signal (still fetching) sends None and lets the server's default apply.

The same fetch + UUID pattern will be reused by PMS-359 (inline edit on ticket detail). RemoteTicketPriority is exported at file scope so the detail page can grab it without re-declaring.

#PMS-358

The New Ticket form had a Priority Select wired to a `priority` signal initialized to "medium", but the submit handler never read it - the POST body only carried title, description, company_id. Every ticket created via the form fell through to the tenant's default priority server-side, which is almost always Medium regardless of what the user picked. Reviewer (Claude for Chrome) reproduced: selecting High persists Medium on detail, list, dashboard, and the Open Tickets by Priority widget. Doubly wrong because the server's CreateTicketRequest takes priority_id: Option<Uuid>, not a string name. Even if the submit handler had read the signal, sending "medium" as priority_id would have been silently coerced to None. Fix lands the proper lookup: the form fetches GET /tickets/priorities on mount (paginated lookup the server has had all along), seeds the signal with whichever row carries is_default = true (or the first row), renders the Select with each priority's UUID as the option value and its name as the label, and serialises the chosen UUID as priority_id in the POST body. Empty signal (still fetching) sends None and lets the server's default apply. The same fetch + UUID pattern will be reused by PMS-359 (inline edit on ticket detail). RemoteTicketPriority is exported at file scope so the detail page can grab it without re-declaring. #PMS-358
fix(tickets): send priority_id on New Ticket create (was dropped silently)
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / clippy + fmt + tests (pull_request) Successful in 1m5s
9e9d1993b3
The New Ticket form had a Priority Select wired to a `priority` signal initialized to "medium", but the submit handler never read it - the POST body only carried title, description, company_id. Every ticket created via the form fell through to the tenant's default priority server-side, which is almost always Medium regardless of what the user picked. Reviewer (Claude for Chrome) reproduced: selecting High persists Medium on detail, list, dashboard, and the Open Tickets by Priority widget.

Doubly wrong because the server's CreateTicketRequest takes priority_id: Option<Uuid>, not a string name. Even if the submit handler had read the signal, sending "medium" as priority_id would have been silently coerced to None.

Fix lands the proper lookup: the form fetches GET /tickets/priorities on mount (paginated lookup the server has had all along), seeds the signal with whichever row carries is_default = true (or the first row), renders the Select with each priority's UUID as the option value and its name as the label, and serialises the chosen UUID as priority_id in the POST body. Empty signal (still fetching) sends None and lets the server's default apply.

The same fetch + UUID pattern will be reused by PMS-359 (inline edit on ticket detail). RemoteTicketPriority is exported at file scope so the detail page can grab it without re-declaring.

#PMS-358
YousifShkara deleted branch fix/pms-358-ticket-priority-not-sent 2026-06-16 06:26:27 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!185
No description provided.