Files
documenso/packages/lib/server-only/webhooks/get-webhook-by-id.ts
2024-02-27 12:13:56 +11:00

16 lines
302 B
TypeScript

import { prisma } from '@documenso/prisma';
export type GetWebhookByIdOptions = {
id: string;
userId: number;
};
export const getWebhookById = async ({ id, userId }: GetWebhookByIdOptions) => {
return await prisma.webhook.findFirstOrThrow({
where: {
id,
userId,
},
});
};