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

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
simoleo89
2026-08-01 14:15:28 +02:00
co-authored by Cursor
parent 7c39aef5d9
commit 2cd0863cb8
40 changed files with 1069 additions and 726 deletions
+7 -5
View File
@@ -1,7 +1,8 @@
import { asc, eq } from "drizzle-orm";
import { redirect } from "next/navigation";
import { getTranslations } from "next-intl/server";
import { db, WebsiteEventType } from "@/lib/db";
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
import { prisma } from "@/lib/prisma";
import { EventForm } from "../event-form";
export default async function CreateEventPage() {
@@ -11,10 +12,11 @@ export default async function CreateEventPage() {
}
const t = await getTranslations("pages.admin.events");
const eventTypes = await prisma.websiteEventType.findMany({
where: { isActive: 1 },
orderBy: { name: "asc" },
});
const eventTypes = await db
.select()
.from(WebsiteEventType)
.where(eq(WebsiteEventType.isActive, 1))
.orderBy(asc(WebsiteEventType.name));
return (
<div className="space-y-6">