Skip to content

Commit

Permalink
fix(findings): remove default status filtering (#6784)
Browse files Browse the repository at this point in the history
(cherry picked from commit bb4685c)
  • Loading branch information
paabloLC committed Feb 3, 2025
1 parent c60f13f commit aeecac9
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 aeecac9

Please sign in to comment.