From 28a76097f6eb277241e1714abc334a9cfac5359d Mon Sep 17 00:00:00 2001 From: daledah Date: Sat, 21 Sep 2024 10:55:29 +0700 Subject: [PATCH] fix: page not found on emoji report field --- src/ROUTES.ts | 2 +- src/libs/Navigation/linkingConfig/config.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 146d35611a72..1a6cf17e0199 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -287,7 +287,7 @@ const ROUTES = { }, EDIT_REPORT_FIELD_REQUEST: { route: 'r/:reportID/edit/policyField/:policyID/:fieldID', - getRoute: (reportID: string, policyID: string, fieldID: string) => `r/${reportID}/edit/policyField/${policyID}/${fieldID}` as const, + getRoute: (reportID: string, policyID: string, fieldID: string) => `r/${reportID}/edit/policyField/${policyID}/${encodeURIComponent(fieldID)}` as const, }, REPORT_WITH_ID_DETAILS_SHARE_CODE: { route: 'r/:reportID/details/shareCode', diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 09ed50a57395..a97e2ddae327 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -1116,7 +1116,12 @@ const config: LinkingOptions['config'] = { }, [SCREENS.RIGHT_MODAL.EDIT_REQUEST]: { screens: { - [SCREENS.EDIT_REQUEST.REPORT_FIELD]: ROUTES.EDIT_REPORT_FIELD_REQUEST.route, + [SCREENS.EDIT_REQUEST.REPORT_FIELD]: { + path: ROUTES.EDIT_REPORT_FIELD_REQUEST.route, + parse: { + fieldID: (fieldID: string) => decodeURIComponent(fieldID), + }, + }, }, }, [SCREENS.RIGHT_MODAL.SIGN_IN]: {