mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 04:51:51 +00:00
srn Updated failed findings count
This commit is contained in:
@@ -38,7 +38,7 @@ export default async function Resources({
|
||||
},
|
||||
});
|
||||
|
||||
if (scansData.data?.length !== 0) {
|
||||
if (scansData?.data?.length !== 0) {
|
||||
const latestScandate = scansData.data?.[0]?.attributes?.inserted_at;
|
||||
const formattedDate = format(parseISO(latestScandate), "yyyy-MM-dd");
|
||||
filters["filter[updated_at]"] = formattedDate;
|
||||
@@ -157,7 +157,7 @@ const SSRDataTable = async ({
|
||||
},
|
||||
});
|
||||
|
||||
if (scansData.data?.length !== 0) {
|
||||
if (scansData?.data?.length !== 0) {
|
||||
const latestScandate = scansData?.data?.[0]?.attributes?.inserted_at;
|
||||
const formattedDate = format(parseISO(latestScandate), "yyyy-MM-dd");
|
||||
filters["filter[updated_at]"] = formattedDate;
|
||||
|
||||
@@ -93,8 +93,10 @@ export const ColumnResources: ColumnDef<ResourceProps>[] = [
|
||||
header: () => <div className="text-center">Failed Findings</div>,
|
||||
cell: ({ row }) => {
|
||||
const count = row.original.relationships.findings.data.filter(
|
||||
(data) => data.attributes.status === "FAIL",
|
||||
(data) =>
|
||||
data.attributes.status === "FAIL" && data.attributes.delta === "new",
|
||||
).length;
|
||||
|
||||
return (
|
||||
<>
|
||||
<p className="text-center">
|
||||
|
||||
@@ -47,7 +47,7 @@ export interface ResourceProps {
|
||||
data: {
|
||||
type: "findings";
|
||||
id: string;
|
||||
attributes: { status: string };
|
||||
attributes: { status: string; delta: string };
|
||||
}[];
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user