refactor(db): migrate app pages and APIs from Prisma facade to Drizzle (3)

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
SimoandCursor committed 2026-08-01 14:15:32 +02:00
1 parent 2cd0863cb8
commit 580972c0a0
40 files changed
+1089 -808

No files matched your search

+8 -4
View File
@@ -5,7 +5,7 @@ import {
} from "@/actions/admin-radio-extra";
import { StatusCard } from "@/components/admin/dashboard";
import { Button } from "@/components/ui/button";
import { prisma } from "@/lib/prisma";
import { db, WebsiteSetting } from "@/lib/db";
type Field = { key: string; comment: string };
type Group = { title: string; fields: Field[] };
@@ -364,9 +364,13 @@ export default async function AdminRadioSettingsPage() {
let extra: Field[] = [];
try {
const rows = await prisma.websiteSetting.findMany({
select: { key: true, value: true, comment: true },
});
const rows = await db
.select({
key: WebsiteSetting.key,
value: WebsiteSetting.value,
comment: WebsiteSetting.comment,
})
.from(WebsiteSetting);
values = new Map(rows.map((r) => [r.key, r.value]));
extra = rows
.filter(