Booking confirm endpoint refactoring (#2949)
* Adds new default handler and responder * Moved confirm endpoint * Fixes availability for unconfirmed bookings * Cleanup * Update _patch.ts * Prevent too much diffs * Adds missing BookingStatus * Migrates confirmed & rejected to status * Adds requiresConfirmation icon to listing * Adds booking status migration * Adds migrations to remove confirmed/rejected * Undo refactor * Sets the organizer as "accepted" in gCal * Update getBusyTimes.ts Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
3b321e5d3c
commit
12d66cb9df
27 files changed
+393
-336
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { ReminderType } from "@prisma/client";
|
||||
import { BookingStatus, ReminderType } from "@prisma/client";
|
||||
import dayjs from "dayjs";
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
@@ -26,8 +26,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
for (const interval of reminderIntervalMinutes) {
|
||||
const bookings = await prisma.booking.findMany({
|
||||
where: {
|
||||
confirmed: false,
|
||||
rejected: false,
|
||||
status: BookingStatus.PENDING,
|
||||
createdAt: {
|
||||
lte: dayjs().add(-interval, "minutes").toDate(),
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user