fix: Fix 'Book a new time' link in request-reschedule for Team Event (#12261)

Co-authored-by: Carina Wollendorfer <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-11-14 13:23:44 -07:00
1 parent 00df493623
commit 9d06f6dd0e
19 files changed
+510 -48

No files matched your search

+9
View File
@@ -12,6 +12,7 @@ vi.mock("@calcom/prisma", () => ({
const handlePrismockBugs = () => {
const __updateBooking = prismock.booking.update;
const __findFirstOrThrowBooking = prismock.booking.findFirstOrThrow;
const __findManyWebhook = prismock.webhook.findMany;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
prismock.booking.update = (...rest: any[]) => {
@@ -34,6 +35,14 @@ const handlePrismockBugs = () => {
return __updateBooking(...rest);
};
prismock.booking.findFirstOrThrow = (...rest: any[]) => {
const { where } = rest[0];
delete where.NOT;
logger.silly("Fixed Prismock bug with using NOT in where clause");
return __findFirstOrThrowBooking(...rest);
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
prismock.webhook.findMany = (...rest: any[]) => {
// There is some bug in prismock where it can't handle complex where clauses