2023-04-25 22:39:47 +00:00
|
|
|
import { getPublicEvent } from "@calcom/features/eventtypes/lib/getPublicEvent";
|
2023-08-24 09:14:10 +00:00
|
|
|
import type { PrismaClient } from "@calcom/prisma";
|
2023-04-25 22:39:47 +00:00
|
|
|
|
|
|
|
import type { TEventInputSchema } from "./event.schema";
|
|
|
|
|
|
|
|
interface EventHandlerOptions {
|
|
|
|
ctx: { prisma: PrismaClient };
|
|
|
|
input: TEventInputSchema;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const eventHandler = async ({ ctx, input }: EventHandlerOptions) => {
|
2023-07-13 14:08:41 +00:00
|
|
|
const event = await getPublicEvent(
|
|
|
|
input.username,
|
|
|
|
input.eventSlug,
|
|
|
|
input.isTeamEvent,
|
|
|
|
input.org,
|
|
|
|
ctx.prisma
|
|
|
|
);
|
2023-04-25 22:39:47 +00:00
|
|
|
return event;
|
|
|
|
};
|