mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* feat: cal ai self serve architecture * chore: add package * chore: update evnet controller * refactor: improvements * chore: rename * chore: type error and naming * chore: just set it to nul * chore: just set it to nul * chore: some more improvements * chore: packate version * fix: API v2 * chore: change name of files * chore: add select * chore: add missing teamId * chore: save progress * refactor: split into multiple services * refactor: make schema provider agonistic * chore: improvements * chore: * chore: remove duplicate files * chore: semicolon * chore: formatting * refactor: logging and error handling * chore: rename variable * refactor: use trpc error * chore: replace with HttpError * chore: remove from option * We need the enum and not just the type --------- Co-authored-by: Hariom Balhara <[email protected]>
28 lines
809 B
TypeScript
28 lines
809 B
TypeScript
import type { z } from "zod";
|
|
|
|
import type { createPhoneCallSchema } from "@calcom/features/calAIPhone/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;
|