fix(tickets,assets): asset_id update + AssetFilter.q so PMS-344 inline editor and picker work end to end #259
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-server!259
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pms-344-asset-filter-and-update-clearing-semantics"
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?
Two server-side gaps surfaced by the PMS-344 verification round.
update_ticket validated the incoming asset_id FK against the assets table but never executed an UPDATE for it, so the SPA's inline asset editor PUT round-tripped and emitted a bare "Updated" audit row with no actual mutation. Added the missing UPDATE block, gated on the new double-Option wire shape: Some(Some(uuid)) sets the association, Some(None) clears it to NULL (powering the Unassign affordance), and None leaves the column unchanged. The custom deserialize_double_option helper in mokosh-types lib.rs is the canonical PATCH-style "field absent vs explicit null" decoder; the AssetPicker is the first consumer and any future PATCH-nullable FK should follow the same shape.
AssetFilter had no q field, so the AssetPicker's
?q=...was silently dropped by axum's Query extractor and the list endpoint returned every asset regardless of typed text. Added the q field with the standard length-200 validator and wired an ILIKE-on-name predicate into list_assets, mirroring CompanyFilter.q. The client-side picker (PMS-371 fix) already issues the query parameter on every keystroke; this just makes the server honour it.#PMS-344