From 199c5ea0a9f94a68dc2adce05da8836f146dca74 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 3 Jun 2025 11:27:46 +0700 Subject: [PATCH] fix: per diem rate Back Button Redirects to Workspace --- src/ROUTES.ts | 4 ++-- src/pages/iou/request/step/IOURequestStepDestination.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 121ce32bdd28..9485b758d8c3 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -1808,11 +1808,11 @@ const ROUTES = { }, WORKSPACE_PER_DIEM: { route: 'settings/workspaces/:policyID/per-diem', - getRoute: (policyID: string | undefined) => { + getRoute: (policyID: string | undefined, backTo?: string) => { if (!policyID) { Log.warn('Invalid policyID is used to build the WORKSPACE_PER_DIEM route'); } - return `settings/workspaces/${policyID}/per-diem` as const; + return getUrlWithBackToParam(`settings/workspaces/${policyID}/per-diem`, backTo); }, }, WORKSPACE_PER_DIEM_IMPORT: { diff --git a/src/pages/iou/request/step/IOURequestStepDestination.tsx b/src/pages/iou/request/step/IOURequestStepDestination.tsx index 63ec2335d3eb..fbe37d170bb8 100644 --- a/src/pages/iou/request/step/IOURequestStepDestination.tsx +++ b/src/pages/iou/request/step/IOURequestStepDestination.tsx @@ -144,7 +144,7 @@ function IOURequestStepDestination({ style={[styles.w100]} onPress={() => { InteractionManager.runAfterInteractions(() => { - Navigation.navigate(ROUTES.WORKSPACE_PER_DIEM.getRoute(policy.id)); + Navigation.navigate(ROUTES.WORKSPACE_PER_DIEM.getRoute(policy.id, Navigation.getActiveRoute())); }); }} text={translate('workspace.perDiem.editPerDiemRates')}