2
0

first commit

This commit is contained in:
2024-08-09 00:39:27 +02:00
commit 79688abe2e
5698 changed files with 497838 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import { HttpError } from "@calcom/lib/http-error";
import logger from "@calcom/lib/logger";
import { safeStringify } from "@calcom/lib/safeStringify";
import { BookingReferenceRepository } from "@calcom/lib/server/repository/bookingReference";
const log = logger.getSubLogger({ prefix: ["daily-video-webhook-handler"] });
export const getBookingReference = async (roomName: string) => {
const bookingReference = await BookingReferenceRepository.findDailyVideoReferenceByRoomName({ roomName });
if (!bookingReference || !bookingReference.bookingId) {
log.error(
"bookingReference not found error:",
safeStringify({
bookingReference,
roomName,
})
);
throw new HttpError({ message: "Booking reference not found", statusCode: 200 });
}
return bookingReference;
};