← back to Wallco Ai
unpublish endpoint: drop updated_at column (doesn't exist on all_designs — psqlExecLocal silent-on-error was swallowing the failure)
696e7396c6964652dbf48f3572958078c1863bf3 · 2026-05-28 09:53:59 -0700 · Steve Abrams
Files touched
Diff
commit 696e7396c6964652dbf48f3572958078c1863bf3
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu May 28 09:53:59 2026 -0700
unpublish endpoint: drop updated_at column (doesn't exist on all_designs — psqlExecLocal silent-on-error was swallowing the failure)
---
server.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/server.js b/server.js
index c3e30cb..00d1bde 100644
--- a/server.js
+++ b/server.js
@@ -18433,7 +18433,9 @@ app.post('/api/design/:id/unpublish', requireAdmin, express.json({ limit: '1kb'
const isLive = String(cur).trim() === 't';
const targetUnpub = (typeof req.body?.unpublish === 'boolean') ? req.body.unpublish : isLive;
const next = targetUnpub ? false : true;
- psqlExecLocal(`UPDATE all_designs SET is_published=${next ? 'TRUE' : 'FALSE'}, updated_at=NOW() WHERE id=${id};`);
+ // all_designs has no updated_at column — keep the UPDATE minimal so the
+ // psqlExecLocal silent-on-error path doesn't swallow a real failure.
+ psqlExecLocal(`UPDATE all_designs SET is_published=${next ? 'TRUE' : 'FALSE'} WHERE id=${id};`);
// Bump in-memory snapshot too so subsequent renders agree
try {
const d = DESIGNS.find(x => x.id === id);
← 88d2c1f design page: sticky admin toolbar (Unpublish / Smart-fix / S
·
back to Wallco Ai
·
design page: scrub URL credentials via history.replaceState 4b8026f →