From f089ff5047953405df6658881bf46b0e2c8e5b54 Mon Sep 17 00:00:00 2001 From: Nulo Date: Thu, 4 Jan 2024 19:45:56 -0300 Subject: [PATCH] arreglar types productpreview --- sitio/src/lib/ProductPreview.svelte | 6 ++++-- sitio/src/routes/+page.svelte | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sitio/src/lib/ProductPreview.svelte b/sitio/src/lib/ProductPreview.svelte index cf377b9..17fa6cc 100644 --- a/sitio/src/lib/ProductPreview.svelte +++ b/sitio/src/lib/ProductPreview.svelte @@ -1,8 +1,10 @@ - {product.name} + {#if product.imageUrl} + {product.name} + {/if}

{product.name}

diff --git a/sitio/src/routes/+page.svelte b/sitio/src/routes/+page.svelte index 349bd3b..e16cb94 100644 --- a/sitio/src/routes/+page.svelte +++ b/sitio/src/routes/+page.svelte @@ -3,6 +3,10 @@ import type { PageData } from "./$types"; export let data: PageData; + $: precios = data.precios.filter( + (d): d is { ean: string; name: string; imageUrl: string | null } => + !!d.name, + );

WIP

@@ -32,7 +36,7 @@

Random