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.

Small referral events fixes

Steven Tey242b1ca662e7
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/page.tsx
index f0eda39ca5..5148a46c5a 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/page.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/page.tsx
@@ -1,4 +1,4 @@
-import { getEvents } from "@/lib/actions/get-conversion-events";
+import { getConversionEvents } from "@/lib/actions/get-conversion-events";
import { getReferralLink } from "@/lib/actions/get-referral-link";
import { getTotalEvents } from "@/lib/actions/get-total-events";
import { EventType } from "@/lib/analytics/types";
@@ -179,9 +179,10 @@ async function ActivityListRSC({
);
}
- const events = await getEvents({ linkId: link.id, event, page });
-
- const totalEvents = await getTotalEvents(link.id);
+ const [events, totalEvents] = await Promise.all([
+ getConversionEvents({ linkId: link.id, event, page }),
+ getTotalEvents(link.id),
+ ]);
return <ActivityList events={events} totalEvents={totalEvents[event] ?? 0} />;
}
diff --git a/apps/web/lib/actions/get-conversion-events.ts b/apps/web/lib/actions/get-conversion-events.ts
index 88d86ef6c3..aaadd28577 100644
--- a/apps/web/lib/actions/get-conversion-events.ts
+++ b/apps/web/lib/actions/get-conversion-events.ts
@@ -10,7 +10,7 @@ import { dub } from "../dub";
export type ConversionEvent = ClickEvent | LeadEvent | SaleEvent;
-export const getEvents = async ({
+export const getConversionEvents = async ({
linkId,
event,
page,
diff --git a/apps/web/scripts/stripe.ts b/apps/web/scripts/stripe-testing.ts
similarity index 100%
rename from apps/web/scripts/stripe.ts
rename to apps/web/scripts/stripe-testing.ts