Files
documenso/packages/lib/server-only/webhooks/get-webhook-by-id.ts
2024-02-14 14:38:58 +02:00

16 lines
302 B
TypeScript

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