Skip to content

Commit

Permalink
prevents sending empty filters to API
Browse files Browse the repository at this point in the history
  • Loading branch information
agnlez committed Nov 8, 2024
1 parent 88cd42b commit 98d1583
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/containers/projects/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function ProjectsHeader() {
<Settings2Icon className="h-4 w-4" />
<span>Filters</span>
{!filtersEqual && (
<span className="absolute right-0 top-0 h-3 w-3 rounded-full border border-border bg-big-stone-600" />
<span className="absolute right-0 top-0 h-3 w-3 rounded-full border border-border bg-foreground" />
)}
</>
</Button>
Expand Down
4 changes: 3 additions & 1 deletion client/src/containers/projects/table/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export const filtersToQueryParams = (
.reduce(
(acc, key) => ({
...acc,
[`filter[${key}]`]: filters[key as keyof typeof filters],
...(filters[key as keyof typeof filters]?.length && {
[`filter[${key}]`]: filters[key as keyof typeof filters],
}),
}),
{},
);
Expand Down

0 comments on commit 98d1583

Please sign in to comment.