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:
parent
b5282f5e00
commit
b1750cfd20
1 changed files with 5 additions and 5 deletions
|
|
@ -831,12 +831,12 @@ router.get("/api/v1/fcc/lookup", async (req, res) => {
|
||||||
|
|
||||||
// Log the check for analytics (non-blocking)
|
// Log the check for analytics (non-blocking)
|
||||||
try {
|
try {
|
||||||
const issueCount = checks?.filter((c: any) => c.severity === "critical" || c.severity === "major").length || 0;
|
const issueCount = checks?.filter((c: any) => c.status === "red" || c.status === "yellow").length || 0;
|
||||||
const worstSeverity = checks?.some((c: any) => c.severity === "critical") ? "critical"
|
const worstSeverity = checks?.some((c: any) => c.status === "red") ? "critical"
|
||||||
: checks?.some((c: any) => c.severity === "major") ? "major"
|
: checks?.some((c: any) => c.status === "yellow") ? "major"
|
||||||
: checks?.some((c: any) => c.severity === "minor") ? "minor" : "clean";
|
: checks?.some((c: any) => c.status === "green") ? "clean" : "clean";
|
||||||
const flaggedSlugs = checks
|
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 || "")
|
.map((c: any) => c.id || c.slug || "")
|
||||||
.filter(Boolean) || [];
|
.filter(Boolean) || [];
|
||||||
const elapsed = Date.now() - startMs;
|
const elapsed = Date.now() - startMs;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue