* add prisma agent repository to features * add * wip * wip * wip * Update apps/web/app/api/webhooks/retell-ai/route.ts Co-authored-by: Volnei Munhoz <volnei@cal.com> * ts fix * ts fix --------- Co-authored-by: Volnei Munhoz <volnei@cal.com>
22 lines
671 B
TypeScript
22 lines
671 B
TypeScript
import { PrismaPhoneNumberRepository } from "@calcom/features/calAIPhone/repositories/PrismaPhoneNumberRepository";
|
|
import prisma from "@calcom/prisma";
|
|
|
|
import type { TrpcSessionUser } from "../../../types";
|
|
import type { TListInputSchema } from "./list.schema";
|
|
|
|
type ListHandlerOptions = {
|
|
ctx: {
|
|
user: NonNullable<TrpcSessionUser>;
|
|
};
|
|
input: TListInputSchema;
|
|
};
|
|
|
|
export const listHandler = async ({ ctx, input }: ListHandlerOptions) => {
|
|
const phoneNumberRepo = new PrismaPhoneNumberRepository(prisma);
|
|
return await phoneNumberRepo.findManyWithUserAccess({
|
|
userId: ctx.user.id,
|
|
teamId: input?.teamId,
|
|
scope: input?.scope || "all",
|
|
});
|
|
};
|