From a3f28058b2d5e07e17fa1ea9ec50641351fafa08 Mon Sep 17 00:00:00 2001 From: tienifr Date: Thu, 14 Mar 2024 17:09:37 +0700 Subject: [PATCH] fix: cannot parse category name with special characters in url --- src/ROUTES.ts | 2 +- src/libs/Navigation/linkingConfig/config.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index ad2d9c10700b..e157c20bd46f 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -555,7 +555,7 @@ const ROUTES = { }, WORKSPACE_CATEGORY_SETTINGS: { route: 'settings/workspaces/:policyID/categories/:categoryName', - getRoute: (policyID: string, categoryName: string) => `settings/workspaces/${policyID}/categories/${encodeURI(categoryName)}` as const, + getRoute: (policyID: string, categoryName: string) => `settings/workspaces/${policyID}/categories/${encodeURIComponent(categoryName)}` as const, }, WORKSPACE_CATEGORIES_SETTINGS: { route: 'settings/workspaces/:policyID/categories/settings', diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 04bc53e7b542..2bfd1b98286b 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -265,7 +265,7 @@ const config: LinkingOptions['config'] = { [SCREENS.WORKSPACE.CATEGORY_SETTINGS]: { path: ROUTES.WORKSPACE_CATEGORY_SETTINGS.route, parse: { - categoryName: (categoryName: string) => decodeURI(categoryName), + categoryName: (categoryName: string) => decodeURIComponent(categoryName), }, }, [SCREENS.WORKSPACE.CATEGORIES_SETTINGS]: {