Files
cal.diy/packages/trpc/server/routers/viewer/organizations/createPhoneCall.handler.ts
T
sean-brydonandKeith Williams 3c1297aa72 fix: calcom trpc sessio circle dep (#19893)
* fix trpc session circle dep

* fixes trpc session cirlce dep

* fix relative imports

* fix more imports to use types and not trpc

* fix exports

* Fixed types

---------

Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2025-03-19 05:50:22 -03:00

28 lines
814 B
TypeScript

import type { z } from "zod";
import type { createPhoneCallSchema } from "@calcom/features/ee/cal-ai-phone/zod-utils";
import { handleCreatePhoneCall } from "@calcom/features/handleCreatePhoneCall";
import type { PrismaClient } from "@calcom/prisma";
import type { TrpcSessionUser } from "@calcom/trpc/server/types";
type CreatePhoneCallProps = {
ctx: {
user: NonNullable<TrpcSessionUser>;
prisma: PrismaClient;
};
input: z.infer<typeof createPhoneCallSchema>;
};
const createPhoneCallHandler = async ({ input, ctx }: CreatePhoneCallProps) => {
return await handleCreatePhoneCall({
user: {
id: ctx.user.id,
timeZone: ctx.user.timeZone,
profile: { organization: { id: ctx.user.profile.organization?.id } },
},
input,
});
};
export default createPhoneCallHandler;