Files
calendar/packages/trpc/server/routers/publicViewer/event.handler.ts
T
Hariom BalharaandGitHub 65df5ac0e4 fix: Allow unpublished org to serve redirected links plus other org onboarding fixes (#14337)
* fix: Allow unpublished org to serve redirected links

* fix: Fix team event link for unpublished org

* fixes

* Rename variable

* Add minimum teams requirement for upgrade

* Fixes

* PR Feedback addressed
2024-04-09 10:33:39 +01: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;