← back to Wallco Ai
designer-studio: un-gate /api/studio/elements (public vocab, no PII) — was 404ing for non-admins → Elements panel blanked for all visitors; + frontend Array.isArray guard
f8d54532b9a1d75fce1c1715e857eb4435e98a17 · 2026-05-31 15:58:03 -0700 · Steve Abrams
Files touched
Diff
commit f8d54532b9a1d75fce1c1715e857eb4435e98a17
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Sun May 31 15:58:03 2026 -0700
designer-studio: un-gate /api/studio/elements (public vocab, no PII) — was 404ing for non-admins → Elements panel blanked for all visitors; + frontend Array.isArray guard
---
server.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/server.js b/server.js
index f3b779e..7917f33 100644
--- a/server.js
+++ b/server.js
@@ -21477,7 +21477,10 @@ app.get('/api/studio/category-insights', async (req, res) => {
});
app.get('/api/studio/elements', (req, res) => {
- if (!isAdmin(req)) return res.status(404).json({ error: 'not found' });
+ // Public endpoint (2026-05-31): wallco_element_lexicon is public creative
+ // vocabulary (motif/animal/monogram names), no PII. The isAdmin gate here was
+ // pasted from the admin generator and silently blanked the /designer-studio
+ // Elements panel for every visitor (frontend did .forEach on the 404 object).
try {
const raw = psqlQuery(`SELECT COALESCE(json_agg(t ORDER BY t.category, t.name), '[]'::json) FROM
(SELECT id, category, name, prompt_phrase FROM wallco_element_lexicon) t;`);
@@ -22021,6 +22024,7 @@ async function loadRefs(){
}).join('');
// Elements grouped by category, with pills
var byCat = {};
+ elements = Array.isArray(elements) ? elements : []; // never let a bad/gated response blank the panel
elements.forEach(function(e){ (byCat[e.category]=byCat[e.category]||[]).push(e); });
window._ELEMENTS_BY_CAT = byCat;
renderElementsList();
← 63432c5 Resume sweep: publish new clean drunk-animals, tag 3 settlem
·
back to Wallco Ai
·
api/room: fall back to IMG_DIR/basename when local_path (oft 7a10d3d →