fix(overview): use findings latest to get new (#8219)

This commit is contained in:
Pepe Fagoaga
2025-07-08 15:48:19 +02:00
committed by GitHub
parent e124275dbf
commit 2de8075d87
2 changed files with 8 additions and 10 deletions
+3
View File
@@ -19,6 +19,9 @@ All notable changes to the **Prowler UI** are documented in this file.
## [v1.8.1] (Prowler 5.8.1)
### 🔄 Changed
- Latest new failed findings now use `GET /findings/latest` [(#8219)](https://github.com/prowler-cloud/prowler/pull/8219)
### Removed
- Validation of the provider's secret type during updates [(#8197)](https://github.com/prowler-cloud/prowler/pull/8197)
+5 -10
View File
@@ -1,8 +1,7 @@
import { Spacer } from "@nextui-org/react";
import { format, subDays } from "date-fns";
import { Suspense } from "react";
import { getFindings } from "@/actions/findings/findings";
import { getLatestFindings } from "@/actions/findings/findings";
import {
getFindingsBySeverity,
getFindingsByStatus,
@@ -129,15 +128,12 @@ const SSRDataNewFindingsTable = async () => {
const page = 1;
const sort = "severity,-inserted_at";
const twoDaysAgo = format(subDays(new Date(), 2), "yyyy-MM-dd");
const defaultFilters = {
"filter[status__in]": "FAIL",
"filter[delta__in]": "new",
"filter[inserted_at__gte]": twoDaysAgo,
"filter[status]": "FAIL",
"filter[delta]": "new",
};
const findingsData = await getFindings({
const findingsData = await getLatestFindings({
query: undefined,
page,
sort,
@@ -178,8 +174,7 @@ const SSRDataNewFindingsTable = async () => {
Latest new failing findings
</h3>
<p className="text-xs text-gray-500">
Showing the latest 10 new failing findings by severity from the last
2 days.
Showing the latest 10 new failing findings by severity.
</p>
</div>
<div className="absolute -top-6 right-0">