fix(tickets): send priority_id on New Ticket create (was dropped silently) #185
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-apps!185
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pms-358-ticket-priority-not-sent"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The New Ticket form had a Priority Select wired to a
prioritysignal 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