diff --git a/api/src/routes/fcc-lookup.ts b/api/src/routes/fcc-lookup.ts index 1c1c85d..f9da0c0 100644 --- a/api/src/routes/fcc-lookup.ts +++ b/api/src/routes/fcc-lookup.ts @@ -831,12 +831,12 @@ router.get("/api/v1/fcc/lookup", async (req, res) => { // Log the check for analytics (non-blocking) try { - const issueCount = checks?.filter((c: any) => c.severity === "critical" || c.severity === "major").length || 0; - const worstSeverity = checks?.some((c: any) => c.severity === "critical") ? "critical" - : checks?.some((c: any) => c.severity === "major") ? "major" - : checks?.some((c: any) => c.severity === "minor") ? "minor" : "clean"; + const issueCount = checks?.filter((c: any) => c.status === "red" || c.status === "yellow").length || 0; + const worstSeverity = checks?.some((c: any) => c.status === "red") ? "critical" + : checks?.some((c: any) => c.status === "yellow") ? "major" + : checks?.some((c: any) => c.status === "green") ? "clean" : "clean"; const flaggedSlugs = checks - ?.filter((c: any) => c.severity === "critical" || c.severity === "major") + ?.filter((c: any) => c.status === "red" || c.status === "yellow") .map((c: any) => c.id || c.slug || "") .filter(Boolean) || []; const elapsed = Date.now() - startMs;