Merge branch 'main' into feat/api-keys

pull/2277/head
kodiakhq[bot] 2022-04-13 17:24:42 +00:00 committed by GitHub
commit 0eaac02fc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 2 deletions

View File

@ -458,11 +458,26 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
});
const credentials = currentUser.credentials;
const calendarBusyTimes: EventBusyDate[] = await prisma.booking
.findMany({
where: {
userId: currentUser.id,
eventTypeId: eventTypeId,
AND: [
{
userId: currentUser.id,
eventTypeId: eventTypeId,
},
{
OR: [
{
status: "ACCEPTED",
},
{
status: "PENDING",
},
],
},
],
},
})
.then((bookings) => bookings.map((booking) => ({ end: booking.endTime, start: booking.startTime })));