removed webhook endpoint creation

This commit is contained in:
Zai Shi 2024-07-25 11:43:46 -07:00
parent f812085420
commit f40b481f03

View File

@ -16,13 +16,12 @@ export async function sendWebhooks(options: {
return;
}
const data = JSON.parse(dataString);
for (const { url, projectId } of data) {
for (const { projectId } of data) {
if (projectId !== options.projectId) {
continue;
}
await svix.application.getOrCreate({ uid: projectId, name: projectId });
await svix.endpoint.create(projectId, { url });
await svix.message.create(projectId, {
eventType: options.type,
payload: {
@ -31,6 +30,6 @@ export async function sendWebhooks(options: {
});
}
} catch (error) {
captureError("Failed to send webhook", error);
captureError("send-webhook", error);
}
}