From 7136623331fa332c56774c350f3ef233f9ed597f Mon Sep 17 00:00:00 2001 From: SJCoetz Date: Fri, 31 Jul 2026 15:31:21 +0200 Subject: [PATCH] feat(orders): expand rep on customers fetch for review modal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Co-authored-by: Orca --- src/app/(app)/orders/page.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/(app)/orders/page.tsx b/src/app/(app)/orders/page.tsx index 421e5a7..9e98d7f 100644 --- a/src/app/(app)/orders/page.tsx +++ b/src/app/(app)/orders/page.tsx @@ -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;