fix(findings): order findings by inserted_at DESC (#6782)

This commit is contained in:
Pablo Lara
2025-02-03 11:51:07 +01:00
committed by GitHub
parent ef6af8e84d
commit 6a95426749
2 changed files with 4 additions and 5 deletions
+3 -4
View File
@@ -26,11 +26,10 @@ export default async function Findings({
searchParams: SearchParamsProps;
}) {
const searchParamsKey = JSON.stringify(searchParams || {});
const defaultSort = "severity,status";
const sort = searchParams.sort?.toString() || defaultSort;
const sort = searchParams.sort?.toString();
// Make sure the sort is correctly encoded
const encodedSort = sort.replace(/^\+/, "");
const encodedSort = sort?.replace(/^\+/, "");
// Extract all filter parameters and combine with default filters
const defaultFilters = {
@@ -137,7 +136,7 @@ const SSRDataTable = async ({
searchParams: SearchParamsProps;
}) => {
const page = parseInt(searchParams.page?.toString() || "1", 10);
const defaultSort = "severity,status";
const defaultSort = "severity,status,-inserted_at";
const sort = searchParams.sort?.toString() || defaultSort;
// Make sure the sort is correctly encoded
+1 -1
View File
@@ -129,7 +129,7 @@ const SSRFindingsBySeverity = async ({
const SSRDataNewFindingsTable = async () => {
const page = 1;
const sort = "severity,updated_at";
const sort = "severity,-inserted_at";
const defaultFilters = {
"filter[status__in]": "FAIL",