Skip to content

Commit

Permalink
rename param
Browse files Browse the repository at this point in the history
  • Loading branch information
mkzie2 committed Nov 22, 2024
1 parent 4e737b3 commit d0918fe
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
10 changes: 5 additions & 5 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ type RequestMoneyParticipantParams = {

type RequestMoneyInformation = {
report: OnyxEntry<OnyxTypes.Report>;
participantData: RequestMoneyParticipantParams;
policyData?: RequestMoneyPolicyParams;
participantParams: RequestMoneyParticipantParams;
policyParams?: RequestMoneyPolicyParams;
gpsPoints?: GPSPoint;
action?: IOUAction;
reimbursible?: boolean;
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/iou/request/step/IOURequestStepAmount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ function IOURequestStepAmount({
playSound(SOUNDS.DONE);
IOU.requestMoney({
report,
participantData: {
participantParams: {
participant: participants.at(0) ?? {},
payeeEmail: currentUserPersonalDetails.login,
payeeAccountID: currentUserPersonalDetails.accountID,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,12 @@ function IOURequestStepConfirmation({
}
IOU.requestMoney({
report,
participantData: {
participantParams: {
payeeEmail: currentUserPersonalDetails.login,
payeeAccountID: currentUserPersonalDetails.accountID,
participant,
},
policyData: {
policyParams: {
policy,
policyTagList: policyTags,
policyCategories,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function IOURequestStepScan({
} else {
IOU.requestMoney({
report,
participantData: {
participantParams: {
payeeEmail: currentUserPersonalDetails.login,
payeeAccountID: currentUserPersonalDetails.accountID,
participant,
Expand Down Expand Up @@ -357,12 +357,12 @@ function IOURequestStepScan({
} else {
IOU.requestMoney({
report,
participantData: {
participantParams: {
payeeEmail: currentUserPersonalDetails.login,
payeeAccountID: currentUserPersonalDetails.accountID,
participant,
},
policyData: {
policyParams: {
policy,
},
gpsPoints: {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/iou/request/step/IOURequestStepScan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function IOURequestStepScan({
} else {
IOU.requestMoney({
report,
participantData: {
participantParams: {
payeeEmail: currentUserPersonalDetails.login,
payeeAccountID: currentUserPersonalDetails.accountID,
participant,
Expand Down Expand Up @@ -387,12 +387,12 @@ function IOURequestStepScan({
} else {
IOU.requestMoney({
report,
participantData: {
participantParams: {
payeeEmail: currentUserPersonalDetails.login,
payeeAccountID: currentUserPersonalDetails.accountID,
participant,
},
policyData: {
policyParams: {
policy,
},
gpsPoints: {
Expand Down
24 changes: 12 additions & 12 deletions tests/actions/IOUTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -1486,7 +1486,7 @@ describe('actions/IOU', () => {
let transaction: OnyxEntry<OnyxTypes.Transaction>;
IOU.requestMoney({
report: {reportID: ''},
participantData: {
participantParams: {
payeeEmail: RORY_EMAIL,
payeeAccountID: RORY_ACCOUNT_ID,
participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID},
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit d0918fe

Please sign in to comment.