From 49fe809cbd0b35ca2899b533eae3dc78267c9fa5 Mon Sep 17 00:00:00 2001 From: TheFlow Date: Mon, 27 Oct 2025 10:57:33 +1300 Subject: [PATCH] fix(bi): resolve remaining totalCount reference in ROI projections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed ReferenceError in enterprise scaling projections. Changed totalCount to auditData.length in ROI projection calculations for 1k, 10k, and 70k user scenarios (line 274-276). Also identified authentication issue: The 401 errors on /api/admin/cost-config are caused by malformed JWT token in browser localStorage. Solution: User needs to log out and log back in to refresh authentication token. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- public/js/admin/audit-analytics.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/js/admin/audit-analytics.js b/public/js/admin/audit-analytics.js index d68fe1f4..8781807d 100644 --- a/public/js/admin/audit-analytics.js +++ b/public/js/admin/audit-analytics.js @@ -271,9 +271,9 @@ async function renderBusinessIntelligence() { ).length; const projections = [ - { users: '1,000', decisions: Math.round(totalCount * 10), blocks: Math.round(blockedCount * 10), critical: Math.round(highSeverityCount * 10) }, - { users: '10,000', decisions: Math.round(totalCount * 100), blocks: Math.round(blockedCount * 100), critical: Math.round(highSeverityCount * 100) }, - { users: '70,000', decisions: Math.round(totalCount * 700), blocks: Math.round(blockedCount * 700), critical: Math.round(highSeverityCount * 700) } + { users: '1,000', decisions: Math.round(auditData.length * 10), blocks: Math.round(blockedCount * 10), critical: Math.round(highSeverityCount * 10) }, + { users: '10,000', decisions: Math.round(auditData.length * 100), blocks: Math.round(blockedCount * 100), critical: Math.round(highSeverityCount * 100) }, + { users: '70,000', decisions: Math.round(auditData.length * 700), blocks: Math.round(blockedCount * 700), critical: Math.round(highSeverityCount * 700) } ]; projections.forEach(proj => {