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.

fix onboarding, add console logs

Steven Tey516c366feca6
diff --git a/apps/web/lib/middleware/app.ts b/apps/web/lib/middleware/app.ts
index f0db528fa2..f4c26c8f6c 100644
--- a/apps/web/lib/middleware/app.ts
+++ b/apps/web/lib/middleware/app.ts
@@ -115,7 +115,7 @@ export async function AppMiddleware(req: NextRequest) {
);
}
- if (path.startsWith("/onboarding")) {
+ if (path === "/onboarding/workspace") {
// Redirect users with pending workspace invites away from onboarding
// to accept their invitation instead of creating a new workspace
const pendingInvite = await prismaEdge.projectInvite.findFirst({
diff --git a/apps/web/lib/rewardful/import-customers.ts b/apps/web/lib/rewardful/import-customers.ts
index d9c80fb920..afa3274ed9 100644
--- a/apps/web/lib/rewardful/import-customers.ts
+++ b/apps/web/lib/rewardful/import-customers.ts
@@ -207,7 +207,7 @@ async function createCustomer({
const customerId = createId({ prefix: "cus_" });
- await prisma.customer.create({
+ const customer = await prisma.customer.create({
data: {
id: customerId,
name:
@@ -230,6 +230,10 @@ async function createCustomer({
},
});
+ console.log(
+ `Created customer ${customer.email} for referral ${link.shortLink}`,
+ );
+
await Promise.allSettled([
recordLeadWithTimestamp({
...clickEvent,
diff --git a/apps/web/lib/rewardful/import-partners.ts b/apps/web/lib/rewardful/import-partners.ts
index a942002541..1063aba320 100644
--- a/apps/web/lib/rewardful/import-partners.ts
+++ b/apps/web/lib/rewardful/import-partners.ts
@@ -222,6 +222,10 @@ async function createPartnerAndLinks({
});
}
+ console.log(
+ `Imported partner ${partner.email} and created ${affiliate.links.length} partner links`,
+ );
+
return {
rewardfulAffiliateId: affiliate.id,
dubPartnerId: partner.id,