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.

Update app-redirect.ts

Steven Tey13f7abc9a6a2
diff --git a/apps/web/lib/middleware/utils/app-redirect.ts b/apps/web/lib/middleware/utils/app-redirect.ts
index 72589fa5b7..234d8e3248 100644
--- a/apps/web/lib/middleware/utils/app-redirect.ts
+++ b/apps/web/lib/middleware/utils/app-redirect.ts
@@ -100,7 +100,9 @@ export const appRedirect = async (path: string) => {
);
// Redirect "/[slug]/[*]/customers/:customerId" to "/[slug]/[*]/customers/:customerId/sales"
- const customersPageRegex = /^\/([^\/]+)\/([^\/]+)\/customers\/([^\/]+)$/;
+ // Exclude "leads" since it's a tab route, not a customer ID
+ const customersPageRegex =
+ /^\/([^\/]+)\/([^\/]+)\/customers\/(?!leads$)([^\/]+)$/;
if (customersPageRegex.test(path))
return path.replace(customersPageRegex, "/$1/$2/customers/$3/sales");