diff --git a/src/server/routes/discovery.ts b/src/server/routes/discovery.ts index 5ae4758..bf60099 100644 --- a/src/server/routes/discovery.ts +++ b/src/server/routes/discovery.ts @@ -5,7 +5,6 @@ import { getRecentGlobalItems, getTrendingCategories, } from "../services/discovery.service.ts"; -import { withImageUrls } from "../services/storage.service.ts"; type Env = { Variables: { db?: any } }; @@ -52,8 +51,7 @@ app.get("/popular-items", async (c) => { } const results = await getPopularItemsByTags(db, tagNames, limit); - const enriched = await withImageUrls(results); - return c.json({ items: enriched }); + return c.json({ items: results }); }); export { app as discoveryRoutes }; diff --git a/src/server/services/discovery.service.ts b/src/server/services/discovery.service.ts index e6e4451..cd41697 100644 --- a/src/server/services/discovery.service.ts +++ b/src/server/services/discovery.service.ts @@ -150,7 +150,7 @@ export async function getPopularItemsByTags( category: string | null; weightGrams: number | null; priceCents: number | null; - imageFilename: string | null; + imageUrl: string | null; description: string | null; ownerCount: number; }> @@ -165,7 +165,7 @@ export async function getPopularItemsByTags( category: globalItems.category, weightGrams: globalItems.weightGrams, priceCents: globalItems.priceCents, - imageFilename: globalItems.imageFilename, + imageUrl: globalItems.imageUrl, description: globalItems.description, ownerCount: sql`CAST(COUNT(DISTINCT ${items.id}) AS INT)`, })