Improve filter handling in SalesClient to reset values for empty selections
This commit is contained in:
@@ -232,7 +232,7 @@ export function SalesClient() {
|
|||||||
<label className="text-xs text-muted-foreground">Agent</label>
|
<label className="text-xs text-muted-foreground">Agent</label>
|
||||||
<Select
|
<Select
|
||||||
value={agentId || ALL}
|
value={agentId || ALL}
|
||||||
onValueChange={(v) => { setAgentId(v === ALL ? '' : v); setPage(1) }}
|
onValueChange={(v) => { setAgentId(!v || v === ALL ? '' : v); setPage(1) }}
|
||||||
>
|
>
|
||||||
<SelectTrigger className="w-44">
|
<SelectTrigger className="w-44">
|
||||||
<SelectValue placeholder="All agents" />
|
<SelectValue placeholder="All agents" />
|
||||||
@@ -250,7 +250,7 @@ export function SalesClient() {
|
|||||||
<label className="text-xs text-muted-foreground">Route</label>
|
<label className="text-xs text-muted-foreground">Route</label>
|
||||||
<Select
|
<Select
|
||||||
value={routeId || ALL}
|
value={routeId || ALL}
|
||||||
onValueChange={(v) => { setRouteId(v === ALL ? '' : v); setPage(1) }}
|
onValueChange={(v) => { setRouteId(!v || v === ALL ? '' : v); setPage(1) }}
|
||||||
>
|
>
|
||||||
<SelectTrigger className="w-44">
|
<SelectTrigger className="w-44">
|
||||||
<SelectValue placeholder="All routes" />
|
<SelectValue placeholder="All routes" />
|
||||||
@@ -268,7 +268,7 @@ export function SalesClient() {
|
|||||||
<label className="text-xs text-muted-foreground">Store</label>
|
<label className="text-xs text-muted-foreground">Store</label>
|
||||||
<Select
|
<Select
|
||||||
value={shopId || ALL}
|
value={shopId || ALL}
|
||||||
onValueChange={(v) => { setShopId(v === ALL ? '' : v); setPage(1) }}
|
onValueChange={(v) => { setShopId(!v || v === ALL ? '' : v); setPage(1) }}
|
||||||
>
|
>
|
||||||
<SelectTrigger className="w-44">
|
<SelectTrigger className="w-44">
|
||||||
<SelectValue placeholder="All stores" />
|
<SelectValue placeholder="All stores" />
|
||||||
|
|||||||
Reference in New Issue
Block a user