8c86c988c1
Uniform stock management for healthcare linen rooms: the coordinator app, the phone counter and the staff app, for your own server. Built from 2d04e45 on 2026-09-15. Licensed under the Functional Source License (FSL-1.1-ALv2).
17 lines
638 B
TypeScript
17 lines
638 B
TypeScript
import { notFound, redirect } from "next/navigation";
|
|
import { prisma } from "@/lib/db";
|
|
import { currentStaff } from "@/lib/staffsession";
|
|
import { wardData } from "@/lib/managerdata";
|
|
import WardScreen from "@/components/screens/Ward";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export default async function MyWard() {
|
|
const sess = await currentStaff();
|
|
if (!sess) redirect("/my/signin");
|
|
const reports = await prisma.staff.count({ where: { managerId: sess.staffId } });
|
|
if (!reports) notFound();
|
|
const { ward, rows, anyCapped } = await wardData(sess);
|
|
return <WardScreen ward={ward} rows={rows} anyCapped={anyCapped} />;
|
|
}
|