TriWorldBench_SPACE / src /lib /data /announcements.ts
TriWorldBench's picture
Update TriWorldBench web from desktop manager
1187856 verified
Raw
History Blame Contribute Delete
303 Bytes
import { getDb } from "@/lib/db";
import { all } from "@/lib/db/helpers";
import type { Announcement } from "@/lib/db/schema";
export function getAnnouncements(): Announcement[] {
return all<Announcement>(
getDb().prepare("SELECT * FROM announcements ORDER BY published_at DESC, id DESC")
);
}