chore: fmt
Build and Push Image / push (push) Has been cancelled
Build and Push Image / build-frontend (push) Has been cancelled
Build and Push Image / build-backend (push) Has been cancelled

This commit is contained in:
2026-06-11 12:34:06 +07:00 Unverified
parent a9e9d3e4d0
commit 925a483bed
+19 -19
View File
@@ -55,31 +55,31 @@ async function Content() {
.orderBy(desc(sum(donations.amount)), asc(max(donations.id)));
const podium = await db
.select({
name: donations.name,
amount: sum(donations.amount).as("amount"),
image: sql<Buffer | null>`
.select({
name: donations.name,
amount: sum(donations.amount).as("amount"),
image: sql<Buffer | null>`
(
array_agg(${donations.image}
ORDER BY ${donations.id} DESC
)
)[1]
`,
})
.from(donations)
.groupBy(donations.name)
.orderBy(desc(sum(donations.amount)), asc(max(donations.id)))
.limit(3)
.then((r) =>
Promise.all(
r.map(async (d) => ({
...d,
image: d.image
? await fileToDataUrl(new File([Buffer.from(d.image)], "image.jpg"))
: undefined,
})),
),
);
})
.from(donations)
.groupBy(donations.name)
.orderBy(desc(sum(donations.amount)), asc(max(donations.id)))
.limit(3)
.then((r) =>
Promise.all(
r.map(async (d) => ({
...d,
image: d.image
? await fileToDataUrl(new File([Buffer.from(d.image)], "image.jpg"))
: undefined,
})),
),
);
return (
<div className="flex min-h-svh flex-col justify-center">