Skip to content

Commit

Permalink
update: edit money function names.
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Gupta <[email protected]>
  • Loading branch information
Krishna2323 committed Nov 17, 2023
1 parent ea890a8 commit 3e59d00
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/MoneyRequestView.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ function MoneyRequestView({report, parentReport, policyCategories, shouldShowHor
<Switch
accessibilityLabel={translate('common.billable')}
isOn={transactionBillable}
onToggle={(value) => IOU.editMoneyOrDistanceRequest(transaction, report.reportID, {billable: value})}
onToggle={(value) => IOU.editMoneyRequest(transaction, report.reportID, {billable: value})}
/>
</View>
)}
Expand Down
12 changes: 6 additions & 6 deletions src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ function createDistanceRequest(report, participant, comment, created, transactio
* @param {Object} [transactionChanges.waypoints]
*
*/
function updateDistanceRequest(transactionID, transactionThreadReportID, transactionChanges) {
function editDistanceMoneyRequest(transactionID, transactionThreadReportID, transactionChanges) {
const optimisticData = [];
const successData = [];
const failureData = [];
Expand Down Expand Up @@ -1771,7 +1771,7 @@ function setDraftSplitTransaction(transactionID, transactionChanges = {}) {
* @param {Number} transactionThreadReportID
* @param {Object} transactionChanges
*/
function editMoneyRequest(transactionID, transactionThreadReportID, transactionChanges) {
function editRegularMoneyRequest(transactionID, transactionThreadReportID, transactionChanges) {
// STEP 1: Get all collections we're updating
const transactionThread = allReports[`${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID}`];
const transaction = allTransactions[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`];
Expand Down Expand Up @@ -1990,11 +1990,11 @@ function editMoneyRequest(transactionID, transactionThreadReportID, transactionC
* @param {Number} transactionThreadReportID
* @param {Object} transactionChanges
*/
function editMoneyOrDistanceRequest(transaction, transactionThreadReportID, transactionChanges) {
function editMoneyRequest(transaction, transactionThreadReportID, transactionChanges) {
if (TransactionUtils.isDistanceRequest(transaction)) {
updateDistanceRequest(transaction.transactionID, transactionThreadReportID, transactionChanges);
editDistanceMoneyRequest(transaction.transactionID, transactionThreadReportID, transactionChanges);
} else {
editMoneyRequest(transaction.transactionID, transactionThreadReportID, transactionChanges);
editRegularMoneyRequest(transaction.transactionID, transactionThreadReportID, transactionChanges);
}
}

Expand Down Expand Up @@ -3007,5 +3007,5 @@ export {
replaceReceipt,
detachReceipt,
getIOUReportID,
editMoneyOrDistanceRequest,
editMoneyRequest,
};
2 changes: 1 addition & 1 deletion src/pages/EditRequestDistancePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function EditRequestDistancePage({report, route, transaction, transactionBackup}
}

transactionWasSaved.current = true;
IOU.editMoneyOrDistanceRequest(transaction, report.reportID, {waypoints});
IOU.editMoneyRequest(transaction, report.reportID, {waypoints});

// If the client is offline, then the modal can be closed as well (because there are no errors or other feedback to show them
// until they come online again and sync with the server).
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EditRequestPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function EditRequestPage({report, route, parentReport, policyCategories, policyT

// Update the transaction object and close the modal
function editMoneyRequest(transactionChanges) {
IOU.editMoneyOrDistanceRequest(transaction, report.reportID, transactionChanges);
IOU.editMoneyRequest(transaction, report.reportID, transactionChanges);
Navigation.dismissModal(report.reportID);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/actions/IOUTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ describe('actions/IOU', () => {
return waitForBatchedUpdates();
})
.then(() => {
IOU.editMoneyOrDistanceRequest(transaction, thread.reportID, {amount: 20000, comment: 'Double the amount!'});
IOU.editMoneyRequest(transaction, thread.reportID, {amount: 20000, comment: 'Double the amount!'});
return waitForBatchedUpdates();
})
.then(
Expand Down Expand Up @@ -1613,7 +1613,7 @@ describe('actions/IOU', () => {
})
.then(() => {
fetch.fail();
IOU.editMoneyOrDistanceRequest(transaction, thread.reportID, {amount: 20000, comment: 'Double the amount!'});
IOU.editMoneyRequest(transaction, thread.reportID, {amount: 20000, comment: 'Double the amount!'});
return waitForBatchedUpdates();
})
.then(
Expand Down

0 comments on commit 3e59d00

Please sign in to comment.