diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index b72b95a0c44f..a28c4490c7c9 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -197,8 +197,8 @@ type RequestMoneyParticipantParams = { type RequestMoneyInformation = { report: OnyxEntry; - participantData: RequestMoneyParticipantParams; - policyData?: RequestMoneyPolicyParams; + participantParams: RequestMoneyParticipantParams; + policyParams?: RequestMoneyPolicyParams; gpsPoints?: GPSPoint; action?: IOUAction; reimbursible?: boolean; @@ -3565,9 +3565,9 @@ function shareTrackedExpense( * Submit expense to another user */ function requestMoney(requestMoneyInformation: RequestMoneyInformation) { - const {report, participantData, policyData = {}, transactionData, gpsPoints, action, reimbursible} = requestMoneyInformation; - const {participant, payeeAccountID, payeeEmail} = participantData; - const {policy, policyCategories, policyTagList} = policyData; + const {report, participantParams, policyParams = {}, transactionData, gpsPoints, action, reimbursible} = requestMoneyInformation; + const {participant, payeeAccountID, payeeEmail} = participantParams; + const {policy, policyCategories, policyTagList} = policyParams; const { amount, currency, diff --git a/src/pages/iou/request/step/IOURequestStepAmount.tsx b/src/pages/iou/request/step/IOURequestStepAmount.tsx index 83cdfa194777..5a9fa9358355 100644 --- a/src/pages/iou/request/step/IOURequestStepAmount.tsx +++ b/src/pages/iou/request/step/IOURequestStepAmount.tsx @@ -212,7 +212,7 @@ function IOURequestStepAmount({ playSound(SOUNDS.DONE); IOU.requestMoney({ report, - participantData: { + participantParams: { participant: participants.at(0) ?? {}, payeeEmail: currentUserPersonalDetails.login, payeeAccountID: currentUserPersonalDetails.accountID, diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx index 7df544e967f9..1c3a34bfff42 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx @@ -240,12 +240,12 @@ function IOURequestStepConfirmation({ } IOU.requestMoney({ report, - participantData: { + participantParams: { payeeEmail: currentUserPersonalDetails.login, payeeAccountID: currentUserPersonalDetails.accountID, participant, }, - policyData: { + policyParams: { policy, policyTagList: policyTags, policyCategories, diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx index 0416315bbafc..29dccaa0f9f1 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx @@ -257,7 +257,7 @@ function IOURequestStepScan({ } else { IOU.requestMoney({ report, - participantData: { + participantParams: { payeeEmail: currentUserPersonalDetails.login, payeeAccountID: currentUserPersonalDetails.accountID, participant, @@ -357,12 +357,12 @@ function IOURequestStepScan({ } else { IOU.requestMoney({ report, - participantData: { + participantParams: { payeeEmail: currentUserPersonalDetails.login, payeeAccountID: currentUserPersonalDetails.accountID, participant, }, - policyData: { + policyParams: { policy, }, gpsPoints: { diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.tsx b/src/pages/iou/request/step/IOURequestStepScan/index.tsx index e646583bb67b..eb40fba34ddf 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/index.tsx @@ -286,7 +286,7 @@ function IOURequestStepScan({ } else { IOU.requestMoney({ report, - participantData: { + participantParams: { payeeEmail: currentUserPersonalDetails.login, payeeAccountID: currentUserPersonalDetails.accountID, participant, @@ -387,12 +387,12 @@ function IOURequestStepScan({ } else { IOU.requestMoney({ report, - participantData: { + participantParams: { payeeEmail: currentUserPersonalDetails.login, payeeAccountID: currentUserPersonalDetails.accountID, participant, }, - policyData: { + policyParams: { policy, }, gpsPoints: { diff --git a/tests/actions/IOUTest.ts b/tests/actions/IOUTest.ts index 909ec1b2068a..1928ed694228 100644 --- a/tests/actions/IOUTest.ts +++ b/tests/actions/IOUTest.ts @@ -82,7 +82,7 @@ describe('actions/IOU', () => { mockFetch?.pause?.(); IOU.requestMoney({ report: {reportID: ''}, - participantData: { + participantParams: { payeeEmail: RORY_EMAIL, payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, @@ -296,7 +296,7 @@ describe('actions/IOU', () => { .then(() => { IOU.requestMoney({ report: chatReport, - participantData: { + participantParams: { payeeEmail: RORY_EMAIL, payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, @@ -515,7 +515,7 @@ describe('actions/IOU', () => { if (chatReport) { IOU.requestMoney({ report: chatReport, - participantData: { + participantParams: { payeeEmail: RORY_EMAIL, payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, @@ -670,7 +670,7 @@ describe('actions/IOU', () => { mockFetch?.pause?.(); IOU.requestMoney({ report: {reportID: ''}, - participantData: { + participantParams: { payeeEmail: RORY_EMAIL, payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, @@ -1486,7 +1486,7 @@ describe('actions/IOU', () => { let transaction: OnyxEntry; IOU.requestMoney({ report: {reportID: ''}, - participantData: { + participantParams: { payeeEmail: RORY_EMAIL, payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, @@ -1722,7 +1722,7 @@ describe('actions/IOU', () => { if (chatReport) { IOU.requestMoney({ report: chatReport, - participantData: { + participantParams: { payeeEmail: RORY_EMAIL, payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, @@ -1850,7 +1850,7 @@ describe('actions/IOU', () => { if (chatReport) { IOU.requestMoney({ report: chatReport, - participantData: { + participantParams: { payeeEmail: RORY_EMAIL, payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, @@ -1951,7 +1951,7 @@ describe('actions/IOU', () => { // When a submit IOU expense is made IOU.requestMoney({ report: chatReport, - participantData: { + participantParams: { payeeEmail: TEST_USER_LOGIN, payeeAccountID: TEST_USER_ACCOUNT_ID, participant: {login: RORY_EMAIL, accountID: RORY_ACCOUNT_ID}, @@ -2700,7 +2700,7 @@ describe('actions/IOU', () => { if (chatReport) { IOU.requestMoney({ report: chatReport, - participantData: { + participantParams: { payeeEmail: TEST_USER_LOGIN, payeeAccountID: TEST_USER_ACCOUNT_ID, participant: {login: RORY_EMAIL, accountID: RORY_ACCOUNT_ID}, @@ -2918,7 +2918,7 @@ describe('actions/IOU', () => { if (chatReport) { IOU.requestMoney({ report: chatReport, - participantData: { + participantParams: { payeeEmail: RORY_EMAIL, payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID, isPolicyExpenseChat: true, reportID: chatReport.reportID}, @@ -3025,7 +3025,7 @@ describe('actions/IOU', () => { if (chatReport) { IOU.requestMoney({ report: chatReport, - participantData: { + participantParams: { payeeEmail: RORY_EMAIL, payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID, isPolicyExpenseChat: true, reportID: chatReport.reportID}, @@ -3133,7 +3133,7 @@ describe('actions/IOU', () => { if (chatReport) { IOU.requestMoney({ report: chatReport, - participantData: { + participantParams: { payeeEmail: RORY_EMAIL, payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID, isPolicyExpenseChat: true, reportID: chatReport.reportID},