Merge branch 'main' into feat/api-keys
commit
0eaac02fc2
|
@ -458,11 +458,26 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||||
});
|
});
|
||||||
|
|
||||||
const credentials = currentUser.credentials;
|
const credentials = currentUser.credentials;
|
||||||
|
|
||||||
const calendarBusyTimes: EventBusyDate[] = await prisma.booking
|
const calendarBusyTimes: EventBusyDate[] = await prisma.booking
|
||||||
.findMany({
|
.findMany({
|
||||||
where: {
|
where: {
|
||||||
userId: currentUser.id,
|
AND: [
|
||||||
eventTypeId: eventTypeId,
|
{
|
||||||
|
userId: currentUser.id,
|
||||||
|
eventTypeId: eventTypeId,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
OR: [
|
||||||
|
{
|
||||||
|
status: "ACCEPTED",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
status: "PENDING",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then((bookings) => bookings.map((booking) => ({ end: booking.endTime, start: booking.startTime })));
|
.then((bookings) => bookings.map((booking) => ({ end: booking.endTime, start: booking.startTime })));
|
||||||
|
|
Loading…
Reference in New Issue