Webhook tweaks + Support added for "Custom payload templates" / x-www-form-urlencoded / json (#1193)

* Changed styling of webhook test & updated <Form> component

* Implements custom webhook formats

Co-authored-by: Bailey Pumfleet <[email protected]>
This commit is contained in:
Alex van AndelandBailey Pumfleet authored and GitHub committed 2021-11-22 11:37:07 +00:00
1 parent ecc960f0a3
commit 5b3dd02747
9 files changed
+169 -124

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
import { WebhookTriggerEvents } from "@prisma/client";
import prisma from "@lib/prisma";
const getSubscribers = async (userId: number, triggerEvent: WebhookTriggerEvents) => {
const allWebhooks = await prisma.webhook.findMany({
where: {
userId: userId,
AND: {
eventTriggers: {
has: triggerEvent,
},
active: {
equals: true,
},
},
},
select: {
subscriberUrl: true,
payloadTemplate: true,
},
});
return allWebhooks;
};
export default getSubscribers;