mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
fix(overview): use findings latest to get new (#8219)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user