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:
1 parent
ecc960f0a3
commit
5b3dd02747
9 files changed
+169
-124
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user