remove appointment from events

This commit is contained in:
PxlLoewe
2026-01-18 01:09:39 +01:00
parent 606379d151
commit 9129652912
22 changed files with 105 additions and 1133 deletions

View File

@@ -14,13 +14,6 @@ const page = async () => {
hidden: false,
},
include: {
Appointments: {
where: {
appointmentDate: {
gte: new Date(),
},
},
},
Participants: {
where: {
userId: user.id,
@@ -32,42 +25,6 @@ const page = async () => {
id: "desc",
},
});
const appointments = await prisma.eventAppointment.findMany({
where: {
appointmentDate: {
gte: new Date(),
},
},
include: {
Participants: {
select: {
enscriptionDate: true,
id: true,
userId: true,
},
where: {
appointmentCancelled: false,
},
orderBy: {
enscriptionDate: "asc",
},
},
_count: {
select: {
Participants: true,
},
},
},
});
const userAppointments = await prisma.eventAppointment.findMany({
where: {
Participants: {
some: {
userId: user.id,
},
},
},
});
return (
<div className="grid grid-cols-6 gap-4">
@@ -78,15 +35,7 @@ const page = async () => {
</div>
{events.map((event) => {
return (
<EventCard
appointments={appointments}
selectedAppointments={userAppointments}
user={user}
event={event}
key={event.id}
/>
);
return <EventCard user={user} event={event} key={event.id} />;
})}
</div>
);