2
0
Files
2024-08-09 00:39:27 +02:00

24 lines
587 B
TypeScript

import { getPublicEvent } from "@calcom/features/eventtypes/lib/getPublicEvent";
import type { PrismaClient } from "@calcom/prisma";
import type { TEventInputSchema } from "./event.schema";
interface EventHandlerOptions {
ctx: { prisma: PrismaClient };
input: TEventInputSchema;
}
export const eventHandler = async ({ ctx, input }: EventHandlerOptions) => {
const event = await getPublicEvent(
input.username,
input.eventSlug,
input.isTeamEvent,
input.org,
ctx.prisma,
input.fromRedirectOfNonOrgLink
);
return event;
};
export default eventHandler;