cal.pub0.org/packages/trpc/server/routers/publicViewer/event.handler.ts

16 lines
468 B
TypeScript

import type { PrismaClient } from "@prisma/client";
import { getPublicEvent } from "@calcom/features/eventtypes/lib/getPublicEvent";
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, ctx.prisma);
return event;
};