fix: request reschedule link in email for an Org event (#12125)

This commit is contained in:
Hariom Balhara authored and GitHub committed 2023-10-30 16:25:12 +05:30
1 parent f81f0a26ec
commit 31fc4724e0
14 files changed
+491 -166

No files matched your search

-30
View File
@@ -13,7 +13,6 @@ vi.mock("@calcom/prisma", () => ({
const handlePrismockBugs = () => {
const __updateBooking = prismock.booking.update;
const __findManyWebhook = prismock.webhook.findMany;
const __findManyBooking = prismock.booking.findMany;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
prismock.booking.update = (...rest: any[]) => {
// There is a bug in prismock where it considers `createMany` and `create` itself to have the data directly
@@ -46,35 +45,6 @@ const handlePrismockBugs = () => {
// @ts-ignore
return __findManyWebhook(...rest);
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
prismock.booking.findMany = (...rest: any[]) => {
// There is a bug in prismock where it considers `createMany` and `create` itself to have the data directly
// In booking flows, we encounter such scenario, so let's fix that here directly till it's fixed in prismock
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const where = rest[0]?.where;
if (where?.OR) {
logger.silly("Fixed Prismock bug-3");
// eslint-disable-next-line @typescript-eslint/no-explicit-any
where.OR.forEach((or: any) => {
if (or.startTime?.gte) {
or.startTime.gte = or.startTime.gte.toISOString ? or.startTime.gte.toISOString() : or.startTime.gte;
}
if (or.startTime?.lte) {
or.startTime.lte = or.startTime.lte.toISOString ? or.startTime.lte.toISOString() : or.startTime.lte;
}
if (or.endTime?.gte) {
or.endTime.lte = or.endTime.gte.toISOString ? or.endTime.gte.toISOString() : or.endTime.gte;
}
if (or.endTime?.lte) {
or.endTime.lte = or.endTime.lte.toISOString ? or.endTime.lte.toISOString() : or.endTime.lte;
}
});
}
return __findManyBooking(...rest);
};
};
beforeEach(() => {