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 partner link constructor

Steven Tey026212809636
diff --git a/apps/web/app/(ee)/app.dub.co/embed/referrals/add-edit-link.tsx b/apps/web/app/(ee)/app.dub.co/embed/referrals/add-edit-link.tsx
index e49fef4649..282e814b64 100644
--- a/apps/web/app/(ee)/app.dub.co/embed/referrals/add-edit-link.tsx
+++ b/apps/web/app/(ee)/app.dub.co/embed/referrals/add-edit-link.tsx
@@ -10,6 +10,7 @@ import {
import {
cn,
getDomainWithoutWWW,
+ linkConstructor,
TAB_ITEM_ANIMATION_SETTINGS,
} from "@dub/utils";
import { Program } from "@prisma/client";
@@ -87,7 +88,12 @@ export function ReferralsEmbedCreateUpdateLink({
},
body: JSON.stringify({
...data,
- url: isExactMode ? undefined : data.url,
+ url: isExactMode
+ ? undefined
+ : linkConstructor({
+ domain: destinationDomain,
+ key: data.url,
+ }),
}),
});
diff --git a/apps/web/ui/modals/partner-link-modal.tsx b/apps/web/ui/modals/partner-link-modal.tsx
index 553cba7c10..fedb8507e2 100644
--- a/apps/web/ui/modals/partner-link-modal.tsx
+++ b/apps/web/ui/modals/partner-link-modal.tsx
@@ -236,7 +236,12 @@ function PartnerLinkModalContent({
},
body: JSON.stringify({
...data,
- url: isExactMode ? undefined : data.url,
+ url: isExactMode
+ ? undefined
+ : linkConstructor({
+ domain: destinationDomain,
+ key: data.url,
+ }),
}),
},
);