Skip to content

Commit

Permalink
fix(findings): remove default status filtering (#6784)
Browse files Browse the repository at this point in the history
  • Loading branch information
paabloLC authored Feb 3, 2025
1 parent 6a95426 commit bb4685c
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions ui/app/(prowler)/findings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ export default async function Findings({
// Make sure the sort is correctly encoded
const encodedSort = sort?.replace(/^\+/, "");

// Extract all filter parameters and combine with default filters
const defaultFilters = {
"filter[status__in]": "FAIL, PASS",
};

const filters: Record<string, string> = {
...defaultFilters,
...Object.fromEntries(
Object.entries(searchParams).filter(([key]) => key.startsWith("filter[")),
Object.entries(searchParams)
.filter(([key]) => key.startsWith("filter["))
.map(([key, value]) => [
key,
Array.isArray(value) ? value.join(",") : value?.toString() || "",
]),
),
};

Expand Down Expand Up @@ -142,15 +141,14 @@ const SSRDataTable = async ({
// Make sure the sort is correctly encoded
const encodedSort = sort.replace(/^\+/, "");

// Extract all filter parameters and combine with default filters
const defaultFilters = {
"filter[status__in]": "FAIL, PASS",
};

const filters: Record<string, string> = {
...defaultFilters,
...Object.fromEntries(
Object.entries(searchParams).filter(([key]) => key.startsWith("filter[")),
Object.entries(searchParams)
.filter(([key]) => key.startsWith("filter["))
.map(([key, value]) => [
key,
Array.isArray(value) ? value.join(",") : value?.toString() || "",
]),
),
};

Expand Down

0 comments on commit bb4685c

Please sign in to comment.