Skip to content

Commit

Permalink
Merge pull request Expensify#25731 from Expensify/cmartins-fixReceipt…
Browse files Browse the repository at this point in the history
…Display

Simplify logic for getTransactionsWithReceipts
  • Loading branch information
tylerkaraszewski authored Aug 29, 2023
2 parents 6dac163 + 94b3d4d commit d84006f
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1334,20 +1334,8 @@ function canEditReportAction(reportAction) {
* @returns {[Object]}
*/
function getTransactionsWithReceipts(iouReportID) {
const reportActions = ReportActionsUtils.getAllReportActions(iouReportID);
return _.reduce(
reportActions,
(transactions, action) => {
if (ReportActionsUtils.isMoneyRequestAction(action)) {
const transaction = TransactionUtils.getLinkedTransaction(action);
if (TransactionUtils.hasReceipt(transaction)) {
transactions.push(transaction);
}
}
return transactions;
},
[],
);
const allTransactions = TransactionUtils.getAllReportTransactions(iouReportID);
return _.filter(allTransactions, (transaction) => TransactionUtils.hasReceipt(transaction));
}

/**
Expand Down

0 comments on commit d84006f

Please sign in to comment.