From 6b8a90714464242b3352ac7b16e156455f196b34 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Thu, 12 Oct 2023 13:39:56 -0400 Subject: [PATCH] encode projectId for backwards compatibility --- src/constants/routes.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/constants/routes.ts b/src/constants/routes.ts index 257538b0b7..795cfc81e5 100644 --- a/src/constants/routes.ts +++ b/src/constants/routes.ts @@ -227,11 +227,9 @@ export const getProjectSettingsRoute = ( projectId: string, tab?: ProjectSettingsTabRoutes ) => { - if (!tab) { - return `${paths.project}/${projectId}/${PageNames.Settings}`; - } - - return `${paths.project}/${projectId}/${PageNames.Settings}/${tab}`; + const encodedProjectId = encodeURIComponent(projectId); + const root = `${paths.project}/${encodedProjectId}/${PageNames.Settings}`; + return tab ? `${root}/${tab}` : root; }; export const getDistroSettingsRoute = (