Add non-destructive dev seed on startup
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { UserRole } from "@prisma/client";
|
||||
|
||||
import { requireRole } from "@/lib/auth-utils";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { ErzieherList } from "./_components/erzieher-list";
|
||||
|
||||
export const metadata = { title: "ErzieherInnen · Kita-Planer" };
|
||||
|
||||
export default async function ErzieherPage() {
|
||||
const session = await requireRole([UserRole.ADMIN]);
|
||||
|
||||
const educators = await prisma.educator.findMany({
|
||||
where: { kitaId: session.user.kitaId! },
|
||||
orderBy: [{ lastName: "asc" }, { firstName: "asc" }],
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="flex h-full flex-col gap-6 p-6">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold tracking-tight">ErzieherInnen-Verwaltung</h1>
|
||||
<p className="text-muted-foreground">
|
||||
Verwalte die Stammdaten des Kita-Personals (nur für den Vorstand sichtbar).
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<ErzieherList educators={educators} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user