* perf: use repository for webhooks list query & caching in /settings/developer/webhooks/... RSC * fix type check * invalidate cache on webhook list item actions * fix review comment * fix merge conflicts
16 lines
463 B
TypeScript
16 lines
463 B
TypeScript
import { WebhookRepository } from "@calcom/lib/server/repository/webhook";
|
|
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) => {
|
|
return await WebhookRepository.findWebhooksByFilters({ userId: ctx.user.id, input });
|
|
};
|