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.

promise.all

Steven Teye9a2d11cb160
diff --git a/apps/web/app/api/track/route.ts b/apps/web/app/api/track/route.ts
index 2d78e4d524..252d585c12 100644
--- a/apps/web/app/api/track/route.ts
+++ b/apps/web/app/api/track/route.ts
@@ -21,21 +21,22 @@ export const POST = withSessionEdge(async ({ req }) => {
return;
}
- await recordConversion({
- ...clickEvent.data[0],
- timestamp: new Date(Date.now()).toISOString(),
- event_id: nanoid(16),
- event_name: eventName,
- event_type: eventType,
- customer_id: customerId,
- metadata,
- });
-
- // TODO: Remove this before launch
- await log({
- message: `*Conversion event recorded*: Customer *${customerId}* converted on click *${clickId}* with event *${eventName}*.`,
- type: "alerts",
- });
+ await Promise.all([
+ recordConversion({
+ ...clickEvent.data[0],
+ timestamp: new Date(Date.now()).toISOString(),
+ event_id: nanoid(16),
+ event_name: eventName,
+ event_type: eventType,
+ customer_id: customerId,
+ metadata,
+ }),
+ // TODO: Remove this before launch
+ log({
+ message: `*Conversion event recorded*: Customer *${customerId}* converted on click *${clickId}* with event *${eventName}*.`,
+ type: "alerts",
+ }),
+ ]);
})(),
);