2
0
Files
2024-08-09 00:39:27 +02:00

31 lines
665 B
TypeScript

import { prisma } from "@calcom/prisma";
import type { TrpcSessionUser } from "@calcom/trpc/server/trpc";
import type { TGetInputSchema } from "./get.schema";
type GetOptions = {
ctx: {
user: NonNullable<TrpcSessionUser>;
};
input: TGetInputSchema;
};
export const getHandler = async ({ ctx: _ctx, input }: GetOptions) => {
return await prisma.webhook.findUniqueOrThrow({
where: {
id: input.webhookId,
},
select: {
id: true,
subscriberUrl: true,
payloadTemplate: true,
active: true,
eventTriggers: true,
secret: true,
teamId: true,
userId: true,
platform: true,
},
});
};