sort entries correctly from /api/all
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { db } from "$lib/server/db";
|
||||
import { entryTable } from "$lib/server/db/schema";
|
||||
import { desc } from "drizzle-orm";
|
||||
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user