The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Check for duplicate destination URL
Kiran Kd0a7fece050b
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/links/add-edit-default-partner-link-sheet.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/links/add-edit-default-partner-link-sheet.tsxindex 1747550e91..2d5aad3688 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/links/add-edit-default-partner-link-sheet.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/links/add-edit-default-partner-link-sheet.tsx@@ -67,6 +67,20 @@ function DefaultPartnerLinkSheetContent({return;}+ // Check for duplicate destination URL+ const isDuplicate = currentDefaultLinks.some((existingLink) => {+ if (linkId && existingLink.id === linkId) {+ return false;+ }++ return existingLink.url === data.url;+ });++ if (isDuplicate) {+ toast.error("A default link with this destination URL already exists.");+ return;+ }+// Editing existing linkif (link) {updatedDefaultLinks = currentDefaultLinks.map((link) => {