fix: attendees not visible for hosts (#21156)
This commit is contained in:
1 parent
1b281fe269
commit
b6ff64ed74
1 file changed
+17
-22
@@ -152,28 +152,6 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||
slug: eventType.team?.slug || eventType.users[0]?.username || null,
|
||||
};
|
||||
|
||||
if (bookingInfo !== null && eventType.seatsPerTimeSlot) {
|
||||
await handleSeatsEventTypeOnBooking(
|
||||
eventType,
|
||||
bookingInfo,
|
||||
seatReferenceUid,
|
||||
session?.user.id === eventType.userId
|
||||
);
|
||||
}
|
||||
|
||||
const payment = await prisma.payment.findFirst({
|
||||
where: {
|
||||
bookingId: bookingInfo.id,
|
||||
},
|
||||
select: {
|
||||
success: true,
|
||||
refunded: true,
|
||||
currency: true,
|
||||
amount: true,
|
||||
paymentOption: true,
|
||||
},
|
||||
});
|
||||
|
||||
const userId = session?.user?.id;
|
||||
|
||||
const checkIfUserIsHost = (userId?: number | null) => {
|
||||
@@ -194,6 +172,23 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||
|
||||
const isLoggedInUserHost = checkIfUserIsHost(userId);
|
||||
|
||||
if (bookingInfo !== null && eventType.seatsPerTimeSlot) {
|
||||
await handleSeatsEventTypeOnBooking(eventType, bookingInfo, seatReferenceUid, isLoggedInUserHost);
|
||||
}
|
||||
|
||||
const payment = await prisma.payment.findFirst({
|
||||
where: {
|
||||
bookingId: bookingInfo.id,
|
||||
},
|
||||
select: {
|
||||
success: true,
|
||||
refunded: true,
|
||||
currency: true,
|
||||
amount: true,
|
||||
paymentOption: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!isLoggedInUserHost) {
|
||||
// Removing hidden fields from responses
|
||||
for (const key in bookingInfo.responses) {
|
||||
|
||||
Reference in new issue
Block a user