mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 12:31:54 +00:00
fix: new errors detected through the app (#8629)
This commit is contained in:
@@ -48,8 +48,8 @@ export const getComplianceOverviewMetadataInfo = async ({
|
||||
if (sort) url.searchParams.append("sort", sort);
|
||||
|
||||
Object.entries(filters).forEach(([key, value]) => {
|
||||
// Define filters to exclude
|
||||
if (key !== "filter[search]") {
|
||||
// Define filters to exclude and check for valid values
|
||||
if (key !== "filter[search]" && value && String(value).trim() !== "") {
|
||||
url.searchParams.append(key, String(value));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -91,12 +91,14 @@ export default async function Compliance({
|
||||
}
|
||||
: undefined;
|
||||
|
||||
const metadataInfoData = await getComplianceOverviewMetadataInfo({
|
||||
query,
|
||||
filters: {
|
||||
"filter[scan_id]": selectedScanId,
|
||||
},
|
||||
});
|
||||
const metadataInfoData = selectedScanId
|
||||
? await getComplianceOverviewMetadataInfo({
|
||||
query,
|
||||
filters: {
|
||||
"filter[scan_id]": selectedScanId,
|
||||
},
|
||||
})
|
||||
: { data: { attributes: { regions: [] } } };
|
||||
|
||||
const uniqueRegions = metadataInfoData?.data?.attributes?.regions || [];
|
||||
|
||||
@@ -140,11 +142,15 @@ const SSRComplianceGrid = async ({
|
||||
// Extract query from filters
|
||||
const query = (filters["filter[search]"] as string) || "";
|
||||
|
||||
const compliancesData = await getCompliancesOverview({
|
||||
scanId,
|
||||
region: regionFilter,
|
||||
query,
|
||||
});
|
||||
// Only fetch compliance data if we have a valid scanId
|
||||
const compliancesData =
|
||||
scanId && scanId.trim() !== ""
|
||||
? await getCompliancesOverview({
|
||||
scanId,
|
||||
region: regionFilter,
|
||||
query,
|
||||
})
|
||||
: { data: [], errors: [] };
|
||||
|
||||
const type = compliancesData?.data?.type;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { getLighthouseConfig } from "@/actions/lighthouse/lighthouse";
|
||||
import { LighthouseIcon } from "@/components/icons/Icons";
|
||||
import { Chat } from "@/components/lighthouse";
|
||||
@@ -7,6 +9,11 @@ export default async function AIChatbot() {
|
||||
const lighthouseConfig = await getLighthouseConfig();
|
||||
|
||||
const hasConfig = !!lighthouseConfig;
|
||||
|
||||
if (!hasConfig) {
|
||||
return redirect("/lighthouse/config");
|
||||
}
|
||||
|
||||
const isActive = lighthouseConfig.is_active ?? false;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user