[object Object]

← back to Designer Wallcoverings

auto-save: 2026-08-01T10:36:04 (1 files) — DW-Agents/vendor-command-center/server.js

895cebe5ce5e3a491bd39c60d3ea138957e99bd8 · 2026-08-01 10:36:11 -0700 · Steve Abrams

Files touched

Diff

commit 895cebe5ce5e3a491bd39c60d3ea138957e99bd8
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sat Aug 1 10:36:11 2026 -0700

    auto-save: 2026-08-01T10:36:04 (1 files) — DW-Agents/vendor-command-center/server.js
---
 DW-Agents/vendor-command-center/server.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/DW-Agents/vendor-command-center/server.js b/DW-Agents/vendor-command-center/server.js
index dc4fd0de..bee4bc4f 100644
--- a/DW-Agents/vendor-command-center/server.js
+++ b/DW-Agents/vendor-command-center/server.js
@@ -2350,7 +2350,8 @@ async function syncVendorCounts() {
               COUNT(CASE WHEN image_url IS NOT NULL AND image_url != '' THEN 1 END) as with_img,
               COUNT(CASE WHEN UPPER(status) = 'DRAFT' THEN 1 END) as draft_cnt,
               COUNT(CASE WHEN UPPER(status) = 'ARCHIVED' THEN 1 END) as arch_cnt
-            FROM shopify_products WHERE ${conditions}`,
+            FROM shopify_products WHERE (${conditions})
+              AND status NOT IN ('DELETED_FROM_SHOPIFY','DUPLICATE_IMPORT')`,
             patterns
           );
           shopifyCount = parseInt(shopRes.rows[0].cnt) || 0;
@@ -2589,10 +2590,13 @@ app.get('/api/vendors/:code/products', async (req, res) => {
 
     const conditions = patterns.map((_, i) => `vendor ILIKE $${i + 1}`).join(' OR ');
     const values = [...patterns];
-    let whereExtra = '';
+    // Stamped mirror rows (deleted-from-live phantoms + numeric-id duplicate shadows)
+    // stay out of the browse by default; ?include_deleted=1 is the escape hatch
+    let whereExtra = req.query.include_deleted === '1'
+      ? '' : ` AND status NOT IN ('DELETED_FROM_SHOPIFY','DUPLICATE_IMPORT')`;
     if (search) {
       values.push('%' + search + '%');
-      whereExtra = ` AND (title ILIKE $${values.length} OR sku ILIKE $${values.length} OR dw_sku ILIKE $${values.length})`;
+      whereExtra += ` AND (title ILIKE $${values.length} OR sku ILIKE $${values.length} OR dw_sku ILIKE $${values.length})`;
     }
     values.push(limit, offset);
 

← 979bc0c9 auto-save: 2026-08-01T06:34:23 (1 files) — shopify/collectio  ·  back to Designer Wallcoverings  ·  auto-save: 2026-08-01T11:06:15 (2 files) — DW-Agents/vendor- 917e7d7d →