* 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>
28 lines
814 B
TypeScript
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;
|