Files
calendar/packages/trpc/server/routers/viewer/phoneNumber/list.handler.ts
T
aa48e72c12 feat: inbound calls in cal ai (#23890)
* feat: lang support

* fix: type errors

* feat: select voice agent

* refactor: address feedback

* refactor: address feedback

* refactor: missing import

* fix: types

* feat: add inbound calls

* chore: formatting

* chore

* feat: finish inbound call

* chore: formatting

* fix: update bug

* fix: types

* refactor: Agent Configuration Sheet (#23930)

* refactor: agent configuration sheet

* chore: use default phone numbre

* refactor: improvements

* refactor: improvements

* fix: types

* fix: feedback

* chore:

* fix: feedback

* fix: prompt

* fix: review

* fix: review

* refactor: class

* refactor: class

* refactor: rename

* Update apps/web/public/static/locales/en/common.json

* Update apps/web/public/static/locales/en/common.json

* chore: update set value

* fix: remove index

* fix: type error

* fix: update tetss

* fix: use logger

* refactor: don't use static

* fix: type

* fix: schema

* refactor:

---------

Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
2025-10-09 11:40:37 +01:00

22 lines
660 B
TypeScript

import { PrismaPhoneNumberRepository } from "@calcom/lib/server/repository/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",
});
};