Fix compliance check logging: use status (red/yellow/green) not severity

Check objects use status field (red/yellow/green), not severity
(critical/major/minor). Logging was always recording 0 issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
justin 2026-05-07 12:10:03 -05:00
parent b5282f5e00
commit b1750cfd20

View file

@ -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;