Remove booking select object
parent
e6dfa35404
commit
9f121ff4eb
|
@ -1,6 +1,25 @@
|
||||||
import type { Prisma, PrismaClient } from "@prisma/client";
|
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({
|
const booking = await prisma.booking.findFirst({
|
||||||
where: {
|
where: {
|
||||||
uid,
|
uid,
|
||||||
|
@ -15,6 +34,12 @@ async function getBooking(prisma: PrismaClient, uid: string) {
|
||||||
select: {
|
select: {
|
||||||
email: true,
|
email: true,
|
||||||
name: true,
|
name: true,
|
||||||
|
...(seatReferenceUId && { bookingSeatsReference: true }),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
user: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue