Files
vfxreview/app/(dashboard)/shoot-log/page.tsx
T
twotalesanimation e24fd8eda0
Deploy / deploy (push) Successful in 3m5s
Supervisor feature
2026-07-11 15:06:12 +02:00

23 lines
694 B
TypeScript

import { auth } from "@/auth";
import { redirect } from "next/navigation";
import { db } from "@/lib/db";
import { ShootLogClient } from "@/components/shoot-log/ShootLogClient";
export const metadata = { title: "Shot Log" };
export default async function ShootLogPage() {
const session = await auth();
if (!session?.user) redirect("/login");
if (!["ADMIN", "PRODUCER", "SUPERVISOR"].includes(session.user.role)) {
redirect("/dashboard");
}
const projects = await db.project.findMany({
where: { status: { in: ["ACTIVE", "ON_HOLD"] } },
select: { id: true, name: true, code: true },
orderBy: { name: "asc" },
});
return <ShootLogClient projects={projects} />;
}