diff --git a/apps/web/lib/getBooking.tsx b/apps/web/lib/getBooking.tsx index a671734f8d..b713b28506 100644 --- a/apps/web/lib/getBooking.tsx +++ b/apps/web/lib/getBooking.tsx @@ -1,6 +1,25 @@ import type { Prisma, PrismaClient } from "@prisma/client"; -async function getBooking(prisma: PrismaClient, uid: string) { +const bookingSelect = { + startTime: true, + description: true, + customInputs: true, + smsReminderNumber: true, + location: true, + attendees: { + select: { + email: true, + name: true, + }, + }, + user: { + select: { + id: true, + }, + }, +}; + +async function getBooking(prisma: PrismaClient, uid: string, seatReferenceUId?: string) { const booking = await prisma.booking.findFirst({ where: { uid, @@ -15,6 +34,12 @@ async function getBooking(prisma: PrismaClient, uid: string) { select: { email: true, name: true, + ...(seatReferenceUId && { bookingSeatsReference: true }), + }, + }, + user: { + select: { + id: true, }, }, },