mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-23 06:36:19 +00:00
Compare commits
No commits in common. "71e66cf437564701395d14f8c5fd645b0bc10682" and "5c52a12fdfb17d6e5e34a8d052704e1746f7a064" have entirely different histories.
71e66cf437
...
5c52a12fdf
2 changed files with 4 additions and 4 deletions
|
@ -32,7 +32,7 @@ const zProductLd = z.object({
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
image: z.string(),
|
image: z.string(),
|
||||||
offers: z.object({
|
offers: z.object({
|
||||||
offers: z.array(
|
offers: z.tuple([
|
||||||
z.object({
|
z.object({
|
||||||
"@type": z.literal("Offer"),
|
"@type": z.literal("Offer"),
|
||||||
price: z.number(),
|
price: z.number(),
|
||||||
|
@ -41,8 +41,8 @@ const zProductLd = z.object({
|
||||||
"http://schema.org/OutOfStock",
|
"http://schema.org/OutOfStock",
|
||||||
"http://schema.org/InStock",
|
"http://schema.org/InStock",
|
||||||
]),
|
]),
|
||||||
})
|
}),
|
||||||
),
|
]),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
type ProductLd = z.infer<typeof zProductLd>;
|
type ProductLd = z.infer<typeof zProductLd>;
|
||||||
|
|
|
@ -12,7 +12,7 @@ export const load: PageServerLoad = async ({ params }) => {
|
||||||
})
|
})
|
||||||
.from(precios)
|
.from(precios)
|
||||||
.groupBy(precios.ean)
|
.groupBy(precios.ean)
|
||||||
.having(sql`max(length(name)) and max(parser_version) and in_stock`)
|
.having(sql`max(length(name))`)
|
||||||
.orderBy(sql`random()`)
|
.orderBy(sql`random()`)
|
||||||
.limit(150);
|
.limit(150);
|
||||||
const res = await q;
|
const res = await q;
|
||||||
|
|
Loading…
Reference in a new issue