remove appointment from events
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
import { AppointmentForm } from "(app)/admin/event/_components/AppointmentForm";
|
||||
import { prisma } from "@repo/db";
|
||||
|
||||
export default async function Page({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string; appointmentId: string }>;
|
||||
}) {
|
||||
const { id: eventId, appointmentId } = await params;
|
||||
|
||||
const event = await prisma.event.findUnique({
|
||||
where: { id: parseInt(eventId) },
|
||||
});
|
||||
|
||||
if (!event) return <div>Event nicht gefunden</div>;
|
||||
|
||||
let appointment = null;
|
||||
if (appointmentId !== "new") {
|
||||
appointment = await prisma.eventAppointment.findUnique({
|
||||
where: { id: parseInt(appointmentId) },
|
||||
include: {
|
||||
Presenter: true,
|
||||
Participants: {
|
||||
include: { User: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
if (!appointment) return <div>Termin nicht gefunden</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
<AppointmentForm event={event} initialAppointment={appointment} appointmentId={appointmentId} />
|
||||
);
|
||||
}
|
||||
@@ -40,11 +40,11 @@ export default async function Page({
|
||||
</Link>
|
||||
</div>
|
||||
<p className="text-left text-2xl font-semibold">
|
||||
<PersonIcon className="mr-2 inline h-5 w-5" /> Event-übersicht für{" "}
|
||||
<PersonIcon className="mr-2 inline h-5 w-5" /> Event-Übersicht für{" "}
|
||||
{`${user.firstname} ${user.lastname} #${user.publicId}`}
|
||||
</p>
|
||||
</div>
|
||||
<ParticipantForm event={event} user={user} participant={participant} />
|
||||
<ParticipantForm event={event} participant={participant} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user