feat(troubleshoot): add event titles to the troubleshoot page (#3434) (#3437)

This commit is contained in:
Heiki authored and GitHub committed 2022-08-03 09:19:16 +02:00
1 parent 6301ea16f8
commit 5358e5848d
4 files changed
+11 -4

No files matched your search

+4 -3
View File
@@ -5,7 +5,7 @@ import logger from "@calcom/lib/logger";
// import { getBusyVideoTimes } from "@calcom/core/videoClient";
// import notEmpty from "@calcom/lib/notEmpty";
import prisma from "@calcom/prisma";
import type { EventBusyDate } from "@calcom/types/Calendar";
import type { EventBusyDetails } from "@calcom/types/Calendar";
export async function getBusyTimes(params: {
credentials: Credential[];
@@ -24,7 +24,7 @@ export async function getBusyTimes(params: {
})}`
);
const startPrismaBookingGet = performance.now();
const busyTimes: EventBusyDate[] = await prisma.booking
const busyTimes: EventBusyDetails[] = await prisma.booking
.findMany({
where: {
userId,
@@ -39,9 +39,10 @@ export async function getBusyTimes(params: {
id: true,
startTime: true,
endTime: true,
title: true,
},
})
.then((bookings) => bookings.map(({ startTime, endTime }) => ({ end: endTime, start: startTime })));
.then((bookings) => bookings.map(({ startTime, endTime, title }) => ({ end: endTime, start: startTime, title })));
logger.silly(`Busy Time from Cal Bookings ${JSON.stringify(busyTimes)}`);
const endPrismaBookingGet = performance.now();
logger.debug(`prisma booking get took ${endPrismaBookingGet - startPrismaBookingGet}ms`);
+1
View File
@@ -132,6 +132,7 @@ export async function getUserAvailability(
end: dayjs(a.end)
.add(currentUser.bufferTime + (afterEventBuffer || 0), "minute")
.toISOString(),
title: a.title,
}));
const schedule = eventType?.schedule