arreglar ordenado de precios

This commit is contained in:
Cat /dev/Nulo 2023-12-25 13:21:33 -03:00
parent e7d8ac8854
commit 88e3aef8ad
2 changed files with 2 additions and 1 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -10,7 +10,8 @@ export const load: PageServerLoad = async ({ params }) => {
.from(precios) .from(precios)
.where(eq(precios.ean, params.ean)) .where(eq(precios.ean, params.ean))
.groupBy(precios.warcRecordId) .groupBy(precios.warcRecordId)
.having(max(precios.parserVersion)); .having(max(precios.parserVersion))
.orderBy(precios.fetchedAt);
const res = await q; const res = await q;
if (res.length === 0) return error(404, "Not Found"); if (res.length === 0) return error(404, "Not Found");