Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

clean waitUntil

Kiran K992c96098941
diff --git a/apps/web/app/api/stripe/connect/webhook/checkout-session-completed.ts b/apps/web/app/api/stripe/connect/webhook/checkout-session-completed.ts
index ca7f7cdeba..6b2c8e2ade 100644
--- a/apps/web/app/api/stripe/connect/webhook/checkout-session-completed.ts
+++ b/apps/web/app/api/stripe/connect/webhook/checkout-session-completed.ts
@@ -121,20 +121,18 @@ export async function checkoutSessionCompleted(event: Stripe.Event) {
]);
waitUntil(
- (async () => {
- sendLinkWebhook({
- trigger: "sale.created",
- linkId,
- data: transformSaleEventData({
- ...saleData,
- ...link,
- customerId: customer.id,
- customerName: customer.name,
- customerEmail: customer.email,
- customerAvatar: customer.avatar,
- }),
- });
- })(),
+ sendLinkWebhook({
+ trigger: "sale.created",
+ linkId,
+ data: transformSaleEventData({
+ ...saleData,
+ ...link,
+ customerId: customer.id,
+ customerName: customer.name,
+ customerEmail: customer.email,
+ customerAvatar: customer.avatar,
+ }),
+ }),
);
return `Checkout session completed for customer with external ID ${dubCustomerId} and invoice ID ${invoiceId}`;
diff --git a/apps/web/app/api/stripe/connect/webhook/customer-created.ts b/apps/web/app/api/stripe/connect/webhook/customer-created.ts
index 014596a792..d85b485979 100644
--- a/apps/web/app/api/stripe/connect/webhook/customer-created.ts
+++ b/apps/web/app/api/stripe/connect/webhook/customer-created.ts
@@ -104,20 +104,18 @@ export async function customerCreated(event: Stripe.Event) {
]);
waitUntil(
- (async () => {
- sendLinkWebhook({
- trigger: "lead.created",
- linkId,
- data: transformLeadEventData({
- ...leadData,
- link,
- customerId: customer.id,
- customerName: customer.name,
- customerEmail: customer.email,
- customerAvatar: customer.avatar,
- }),
- });
- })(),
+ sendLinkWebhook({
+ trigger: "lead.created",
+ linkId,
+ data: transformLeadEventData({
+ ...leadData,
+ link,
+ customerId: customer.id,
+ customerName: customer.name,
+ customerEmail: customer.email,
+ customerAvatar: customer.avatar,
+ }),
+ }),
);
return `Customer created: ${customer.id}`;
diff --git a/apps/web/app/api/stripe/connect/webhook/invoice-paid.ts b/apps/web/app/api/stripe/connect/webhook/invoice-paid.ts
index f08ff205e1..612a21d9a0 100644
--- a/apps/web/app/api/stripe/connect/webhook/invoice-paid.ts
+++ b/apps/web/app/api/stripe/connect/webhook/invoice-paid.ts
@@ -104,20 +104,18 @@ export async function invoicePaid(event: Stripe.Event) {
]);
waitUntil(
- (async () => {
- sendLinkWebhook({
- trigger: "sale.created",
- linkId,
- data: transformSaleEventData({
- ...saleData,
- ...link,
- customerId: customer.id,
- customerName: customer.name,
- customerEmail: customer.email,
- customerAvatar: customer.avatar,
- }),
- });
- })(),
+ sendLinkWebhook({
+ trigger: "sale.created",
+ linkId,
+ data: transformSaleEventData({
+ ...saleData,
+ ...link,
+ customerId: customer.id,
+ customerName: customer.name,
+ customerEmail: customer.email,
+ customerAvatar: customer.avatar,
+ }),
+ }),
);
return `Sale recorded for customer ID ${customer.id} and invoice ID ${invoiceId}`;
diff --git a/apps/web/app/api/track/lead/route.ts b/apps/web/app/api/track/lead/route.ts
index e1b78b9596..1e85ab820e 100644
--- a/apps/web/app/api/track/lead/route.ts
+++ b/apps/web/app/api/track/lead/route.ts
@@ -141,17 +141,15 @@ export const POST = withWorkspaceEdge(
});
waitUntil(
- (async () => {
- sendLinkWebhookOnEdge({
- trigger: "lead.created",
- linkId: link.id,
- data: transformLeadEventData({
- ...response,
- ...clickData,
- link,
- }),
- });
- })(),
+ sendLinkWebhookOnEdge({
+ trigger: "lead.created",
+ linkId: link.id,
+ data: transformLeadEventData({
+ ...response,
+ ...clickData,
+ link,
+ }),
+ }),
);
return NextResponse.json(response);