Skip to content

Commit

Permalink
Remove booking select object
Browse files Browse the repository at this point in the history
  • Loading branch information
joeauyeung committed Feb 22, 2023
1 parent e6dfa35 commit 9f121ff
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion apps/web/lib/getBooking.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -15,6 +34,12 @@ async function getBooking(prisma: PrismaClient, uid: string) {
select: {
email: true,
name: true,
...(seatReferenceUId && { bookingSeatsReference: true }),
},
},
user: {
select: {
id: true,
},
},
},
Expand Down

0 comments on commit 9f121ff

Please sign in to comment.