Files
calendar/packages/trpc/server/routers/viewer/webhook/list.handler.ts
T
Syed Ali ShahbazandGitHub 4115eaacbd chore: Add initial webhook wiring (TRPC handlers) to the new architecture (#27170)
* --init

* clean up

* unnecessary comment

* remove comment

* fix factory resolver

* Add active filter to webhook query
2026-01-23 16:50:34 +04:00

23 lines
692 B
TypeScript

import { getWebhookFeature } from "@calcom/features/di/webhooks/containers/webhook";
import type { Webhook } from "@calcom/features/webhooks/lib/dto/types";
import type { TrpcSessionUser } from "@calcom/trpc/server/types";
import type { TListInputSchema } from "./list.schema";
type ListOptions = {
ctx: {
user: NonNullable<TrpcSessionUser>;
};
input: TListInputSchema;
};
export const listHandler = async ({ ctx, input }: ListOptions): Promise<Webhook[]> => {
const { repository } = getWebhookFeature();
return repository.listWebhooks({
userId: ctx.user.id,
appId: input?.appId,
eventTypeId: input?.eventTypeId,
eventTriggers: input?.eventTriggers,
});
};