From a1faa4f73cbdb8dbbbb63e4fc2d0bdb084257cde Mon Sep 17 00:00:00 2001 From: Nulo Date: Thu, 4 Jan 2024 22:47:57 -0300 Subject: [PATCH] conseguir ultima imagen y nombre para pagina --- sitio/src/routes/ean/[ean]/+page.server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sitio/src/routes/ean/[ean]/+page.server.ts b/sitio/src/routes/ean/[ean]/+page.server.ts index cc98182..9f9f9e3 100644 --- a/sitio/src/routes/ean/[ean]/+page.server.ts +++ b/sitio/src/routes/ean/[ean]/+page.server.ts @@ -13,7 +13,7 @@ export const load: PageServerLoad = async ({ params }) => { const res = await q; if (res.length === 0) return error(404, "Not Found"); - const meta = res.find((p) => p.name); + const meta = res.findLast((p) => p.name); return { precios: res, meta }; };