Remove booking select object

This commit is contained in:
Joe Au-Yeung 2023-02-21 22:23:42 -05:00
parent e6dfa35404
commit 9f121ff4eb

View File

@ -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,
},
},
},