[object Object]

← back to 1890swallpaper

fix: /api/facets total counts the niche-filtered list actually served

8648424c9821a27b96db8c1ce3f7c916ac62fee7 · 2026-05-19 08:19:55 -0700 · SteveStudio2

total reported PRODUCTS.length (pre-niche-filter) while every facet
handler serves PRODUCTS_NICHE — inconsistent count vs grid.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 8648424c9821a27b96db8c1ce3f7c916ac62fee7
Author: SteveStudio2 <steve@designerwallcoverings.com>
Date:   Tue May 19 08:19:55 2026 -0700

    fix: /api/facets total counts the niche-filtered list actually served
    
    total reported PRODUCTS.length (pre-niche-filter) while every facet
    handler serves PRODUCTS_NICHE — inconsistent count vs grid.
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---
 server.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server.js b/server.js
index 1b07a64..9cb2fb9 100644
--- a/server.js
+++ b/server.js
@@ -174,7 +174,7 @@ app.get('/api/facets', (req, res) => {
     aesthetics[p.aesthetic] = (aesthetics[p.aesthetic] || 0) + 1;
     vendors[p.vendor] = (vendors[p.vendor] || 0) + 1;
   }
-  res.json({ aesthetics, vendors, total: PRODUCTS.length });
+  res.json({ aesthetics, vendors, total: PRODUCTS_NICHE.length });
 });
 
 app.get('/api/health', (req, res) => res.json({ status: 'ok', count: PRODUCTS_NICHE.length, dropped: DROPPED }));

← 94164bd fix: honor sort param in product grid + hydrate saved sort b  ·  back to 1890swallpaper  ·  chore: untrack snapshot files, ignore *.bak/*.pre-*, 404-gua b5d0ee4 →