fix(24): add withImageUrls to public setup endpoint

Public setup view was missing image URL enrichment, causing item images
to be absent for anonymous visitors. Matches the private endpoint pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 10:17:32 +02:00
parent 9177296223
commit e1afd542ac

View File

@@ -48,7 +48,8 @@ app.get("/:id/public", async (c) => {
if (!id) return c.json({ error: "Invalid setup ID" }, 400); if (!id) return c.json({ error: "Invalid setup ID" }, 400);
const setup = await getPublicSetupWithItems(db, id); const setup = await getPublicSetupWithItems(db, id);
if (!setup) return c.json({ error: "Setup not found" }, 404); if (!setup) return c.json({ error: "Setup not found" }, 404);
return c.json(setup); const enrichedItems = await withImageUrls(setup.items);
return c.json({ ...setup, items: enrichedItems });
}); });
app.get("/:id", async (c) => { app.get("/:id", async (c) => {