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.

allow changing upper/lowercase when editing link

Steven Tey904716c23f74
diff --git a/apps/web/lib/api/links.ts b/apps/web/lib/api/links.ts
index c2edbb61c1..d11e32abba 100644
--- a/apps/web/lib/api/links.ts
+++ b/apps/web/lib/api/links.ts
@@ -583,7 +583,7 @@ export async function editLink({
geo,
} = updatedLink;
const hasPassword = password && password.length > 0 ? true : false;
- const changedKey = key !== oldKey;
+ const changedKey = key.toLowerCase() !== oldKey.toLowerCase();
const changedDomain = domain !== oldDomain;
const uploadedImage = image && image.startsWith("data:image") ? true : false;
diff --git a/apps/web/ui/modals/add-edit-link-modal/index.tsx b/apps/web/ui/modals/add-edit-link-modal/index.tsx
index d2801a9b7b..3c31ad213f 100644
--- a/apps/web/ui/modals/add-edit-link-modal/index.tsx
+++ b/apps/web/ui/modals/add-edit-link-modal/index.tsx
@@ -106,7 +106,7 @@ function AddEditLinkModal({
if (
showAddEditLinkModal &&
debouncedKey.length > 0 &&
- debouncedKey !== props?.key
+ debouncedKey.toLowerCase() !== props?.key.toLowerCase()
) {
fetch(
`/api/links/exists?domain=${domain}&key=${debouncedKey}${