[object Object]

← back to Healthcarewallpaper

rails: tag-aware facet filter (productInRail) so rail drill-down + pills return products (fix regression)

03acc238904c02781b415f6282caaba99e600256 · 2026-05-26 10:45:59 -0700 · Steve Abrams

Files touched

Diff

commit 03acc238904c02781b415f6282caaba99e600256
Author: Steve Abrams <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 d93ee39..18b671a 100644
--- a/server.js
+++ b/server.js
@@ -23,7 +23,7 @@ if (ADMIN_ENABLED) {
 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 : [];
-const { buildRails, railFacets } = require('../_shared/rail-match');
+const { buildRails, railFacets, productInRail } = require('../_shared/rail-match');
 
 function isJunk(p) {
   if (!p.image_url || !p.image_url.trim()) return true;
@@ -168,7 +168,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));
   if (vendor && vendor !== 'all') list = list.filter(p => p.vendor === vendor);
   list = sortProducts(list, sort);
   const total = list.length;

← f427902 rails: tag-aware via shared rail-match helper + editorial LA  ·  back to Healthcarewallpaper  ·  sku-redact: wire shared vendor-id display scrubber b0df2c9 →