sort entries correctly from /api/all

This commit is contained in:
2026-02-03 20:02:54 +13:00
parent 143ec73da5
commit faed363820

View File

@@ -1,8 +1,9 @@
import { db } from "$lib/server/db"; import { db } from "$lib/server/db";
import { entryTable } from "$lib/server/db/schema"; import { entryTable } from "$lib/server/db/schema";
import { desc } from "drizzle-orm";
export async function GET() { export async function GET() {
const entries = await db.select().from(entryTable) const entries = await db.select().from(entryTable).orderBy(desc(entryTable.date))
return new Response(JSON.stringify(entries)) return new Response(JSON.stringify(entries))
} }