From a673476ef0309695316a29d31ea614ed7b2cb353 Mon Sep 17 00:00:00 2001 From: Joe Gambino Date: Tue, 16 Mar 2021 13:59:00 -0700 Subject: [PATCH] remove unused param, add comments --- src/libs/actions/Report.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index b88262803e42..4bc910c4c3ac 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -529,12 +529,11 @@ function getSimplifiedIOUReport(reportID, reportData) { } /** - * Fetches the updated data for an IOU Report and updates the IOU collection in ONYX + * Fetches the updated data for an IOU Report and updates the IOU collection in Onyx * - * @param {Number} reportID * @param {Object[]} reportHistory */ -function updateIOUReportData(reportID, reportHistory) { +function updateIOUReportData(reportHistory) { const containsIOUAction = _.any(reportHistory, action => action.actionName === 'IOU'); // If there aren't any IOU actions, we don't need to fetch any additional data @@ -553,14 +552,14 @@ function updateIOUReportData(reportID, reportHistory) { return; } - // If we have an IOU action, get the IOU reportID + // Since the Chat and the IOU are different reports with different reportIDs, and GetIOUReport only returns the + // IOU's reportID, keep track of the IOU's reportID so we can use it to get the IOUReport data via `GetReportStuff` let iouReportID = 0; API.GetIOUReport({ debtorEmail: otherParticipants[0], }).then((response) => { iouReportID = response.reportID; - Log.info('[Report] Fetching IOU report data', true, iouReportID); return API.Get({ returnValueList: 'reportStuff', reportIDList: iouReportID, @@ -608,7 +607,7 @@ function fetchActions(reportID, offset) { .max() .value(); - updateIOUReportData(reportID, indexedData); + updateIOUReportData(indexedData); Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, indexedData); Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {maxSequenceNumber});