feat: support team webhooks

This commit is contained in:
Mythie
2024-02-27 16:56:32 +11:00
parent 7dd2bbd8ab
commit a4b1f7c983
15 changed files with 505 additions and 29 deletions

View File

@ -14,6 +14,10 @@ export const getAllWebhooksByEventTrigger = async ({
}: GetAllWebhooksByEventTriggerOptions) => {
return prisma.webhook.findMany({
where: {
enabled: true,
eventTriggers: {
has: event,
},
...(teamId
? {
team: {
@ -29,10 +33,6 @@ export const getAllWebhooksByEventTrigger = async ({
userId,
teamId: null,
}),
eventTriggers: {
has: event,
},
enabled: true,
},
});
};