Skip to content

Commit

Permalink
removed webhook endpoint creation
Browse files Browse the repository at this point in the history
  • Loading branch information
fomalhautb committed Jul 25, 2024
1 parent f812085 commit f40b481
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/backend/src/lib/webhooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -31,6 +30,6 @@ export async function sendWebhooks(options: {
});
}
} catch (error) {
captureError("Failed to send webhook", error);
captureError("send-webhook", error);
}
}

0 comments on commit f40b481

Please sign in to comment.