feat(orders): expand rep on customers fetch for review modal

The customers getFullList in OrdersReviewModalMount now expands
both 'company' and 'rep'. The Review Order modal's customer
cascade reads selectedCustomer.expand.rep.name to populate the
Rep label and writes it to orders.rep on save.

No other consumer of the customer list reads c.expand.* — the
scout confirmed this is safe.

Co-Authored-By: Claude <noreply@anthropic.com>

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
SJCoetz 2026-07-31 15:31:21 +02:00
parent 5af04e4b60
commit 7136623331

View file

@ -177,7 +177,11 @@ function OrdersReviewModalMount({
getOrderItems(orderId),
pb.collection("customers").getFullList({
sort: "-created",
expand: "company",
// 'rep' is needed by the Review Order modal's customer
// cascade — it reads selectedCustomer.expand.rep.name to
// populate the Rep label and (on save) writes it to
// orders.rep. No other consumer reads c.expand.*.
expand: "company,rep",
}),
]);
if (cancelled) return;