← back to 1900swallpaper
rails: tag-aware facet filter (productInRail) so rail drill-down + pills return products (fix regression)
c2b910368a7d80f4da54b8ce9cb42a7a8f98b5f1 · 2026-05-26 10:45:59 -0700 · SteveStudio2
Files touched
Diff
commit c2b910368a7d80f4da54b8ce9cb42a7a8f98b5f1
Author: SteveStudio2 <steve@designerwallcoverings.com>
Date: Tue May 26 10:45:59 2026 -0700
rails: tag-aware facet filter (productInRail) so rail drill-down + pills return products (fix regression)
---
server.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/server.js b/server.js
index ba946ce..d63a1dc 100644
--- a/server.js
+++ b/server.js
@@ -20,7 +20,7 @@ if (ADMIN_ENABLED) {
try { catalog = require('../_shared/admin-catalog'); }
catch (e) { console.error(`[${__SITE}] admin-catalog unavailable (${e.message}) — falling back to static JSON`); }
}
-const { buildRails, railFacets } = require('../_shared/rail-match');
+const { buildRails, railFacets, productInRail } = require('../_shared/rail-match');
const siteCfg = JSON.parse(fs.readFileSync(path.join(__dirname, 'site.config.json'), 'utf8'));
const SITE_SLUG = siteCfg.slug || __SITE;
const SITE_RAILS = Array.isArray(siteCfg.rails) ? siteCfg.rails : [];
@@ -164,7 +164,7 @@ app.get('/api/products', (req, res) => {
const needle = q.toLowerCase();
list = list.filter(p => (p.title || '').toLowerCase().includes(needle) || (p.tags || []).some(t => t.toLowerCase().includes(needle)));
}
- if (aesthetic && aesthetic !== 'all') list = list.filter(p => p.aesthetic === aesthetic);
+ if (aesthetic && aesthetic !== 'all') list = list.filter(p => productInRail(p, aesthetic));
// SWEEP-A1: tag filter — sub-bucket rails on the homepage call /api/products?tag=<name>
if (req.query.tag) {
const wanted = String(req.query.tag).toLowerCase();
← d5fdd5d rails: tag-aware via shared rail-match helper + editorial LA
·
back to 1900swallpaper
·
sku-redact: wire shared vendor-id display scrubber 67c2d26 →