Improve filter handling in SalesClient to reset values for empty selections
CI/CD - ERP Distribution / Build & Deploy Backend (pull_request) Failing after 12m24s
CI/CD - ERP Distribution / Build & Deploy Frontend (pull_request) Failing after 16m17s

This commit is contained in:
Kalana B. Thilakarathna
2026-09-21 09:35:05 +05:30
parent 34ffc7f97a
commit 3c17047550
@@ -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" />