{product.name}
+ diff --git a/sitio/src/routes/search/+page.server.ts b/sitio/src/routes/search/+page.server.ts index 1cc696a..65f2783 100644 --- a/sitio/src/routes/search/+page.server.ts +++ b/sitio/src/routes/search/+page.server.ts @@ -6,10 +6,12 @@ const { precios } = schema; export const load: PageServerLoad = async ({ url }) => { const query = url.searchParams.get("q"); - let results: null | { ean: string; name: string }[] = null; + let results: null | { ean: string; name: string; imageUrl: string }[] = null; if (query) { results = db.all( - sql`select ean, name from precios_fts where name match ${query};`, + sql`select p.ean, p.name, p.image_url as imageUrl from precios_fts f + join precios p on p.ean = f.ean + where f.name match ${query};`, ); } diff --git a/sitio/src/routes/search/+page.svelte b/sitio/src/routes/search/+page.svelte index a7ef847..401ff16 100644 --- a/sitio/src/routes/search/+page.svelte +++ b/sitio/src/routes/search/+page.svelte @@ -1,4 +1,5 @@