From 53d7650f2d5ca7a7ecaa617d109c0be3f1d605fc Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Mon, 25 Nov 2024 18:12:29 +0530 Subject: [PATCH] add file and currency parameter. Signed-off-by: krishna2323 --- src/libs/API/parameters/CreateWorkspaceParams.ts | 2 ++ src/libs/actions/Policy/Policy.ts | 4 +++- src/pages/workspace/WorkspacesListPage.tsx | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libs/API/parameters/CreateWorkspaceParams.ts b/src/libs/API/parameters/CreateWorkspaceParams.ts index 91c1039169aa..313ef1bd6268 100644 --- a/src/libs/API/parameters/CreateWorkspaceParams.ts +++ b/src/libs/API/parameters/CreateWorkspaceParams.ts @@ -11,6 +11,8 @@ type CreateWorkspaceParams = { customUnitID: string; customUnitRateID: string; engagementChoice?: string; + currency: string; + file?: File; }; export default CreateWorkspaceParams; diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index 09ea43844e04..93cbbc1bbad8 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -1643,7 +1643,7 @@ function buildPolicyData( owner: sessionEmail, ownerAccountID: sessionAccountID, isPolicyExpenseChatEnabled: true, - outputCurrency: currency || outputCurrency, + outputCurrency, pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, autoReporting: true, autoReportingFrequency: CONST.POLICY.AUTO_REPORTING_FREQUENCIES.INSTANT, @@ -1854,6 +1854,8 @@ function buildPolicyData( customUnitID, customUnitRateID, engagementChoice, + currency: outputCurrency, + file, }; return {successData, optimisticData, failureData, params}; diff --git a/src/pages/workspace/WorkspacesListPage.tsx b/src/pages/workspace/WorkspacesListPage.tsx index 52115bc4be1d..05b19a37b1f6 100755 --- a/src/pages/workspace/WorkspacesListPage.tsx +++ b/src/pages/workspace/WorkspacesListPage.tsx @@ -31,7 +31,6 @@ import Navigation from '@libs/Navigation/Navigation'; import * as PolicyUtils from '@libs/PolicyUtils'; import * as ReportUtils from '@libs/ReportUtils'; import type {AvatarSource} from '@libs/UserUtils'; -import * as App from '@userActions/App'; import * as Policy from '@userActions/Policy/Policy'; import * as Session from '@userActions/Session'; import CONST from '@src/CONST'; @@ -368,7 +367,7 @@ function WorkspacesListPage() { accessibilityLabel={translate('workspace.new.newWorkspace')} success text={translate('workspace.new.newWorkspace')} - onPress={() => interceptAnonymousUser(() => App.createWorkspaceWithPolicyDraftAndNavigateToIt())} + onPress={() => interceptAnonymousUser(() => Navigation.navigate(ROUTES.WORKSPACE_CONFIRMATION))} icon={Expensicons.Plus} style={[shouldUseNarrowLayout && styles.flexGrow1, shouldUseNarrowLayout && styles.mb3]} />