ui fix
This commit is contained in:
@@ -757,3 +757,19 @@ export function useRiderLive(userids: readonly number[], isEnabled = true) {
|
||||
isFetching: results.some((result) => result.isFetching),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* What is in one order — the line items, and the total Fiesta computed.
|
||||
*
|
||||
* Enabled only when a drawer is actually open on an order, because this is a
|
||||
* request per order and the list behind it can hold hundreds. A delivery row
|
||||
* carries the same `orderheaderid`, so the same hook serves both kinds of sheet.
|
||||
*/
|
||||
export function useOrderItems(orderheaderid: number | undefined) {
|
||||
return useQuery({
|
||||
queryKey: queryKeys.insights.orderItems(orderheaderid ?? 0),
|
||||
queryFn: () => insightsApi.orderItems(orderheaderid as number),
|
||||
enabled: Boolean(orderheaderid),
|
||||
...stable,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user