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

23 lines
551 B
TypeScript
Raw Normal View History

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
);
return event;
};
export default eventHandler;