From 3db577e105b3d4ad20450c473147eeb2465e885f Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Wed, 13 Jul 2022 11:42:47 +0100 Subject: [PATCH 1/3] add API read command --- src/pages/iou/IOUDetailsModal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/iou/IOUDetailsModal.js b/src/pages/iou/IOUDetailsModal.js index 0835558d4423..f152ee11fa50 100644 --- a/src/pages/iou/IOUDetailsModal.js +++ b/src/pages/iou/IOUDetailsModal.js @@ -93,6 +93,7 @@ class IOUDetailsModal extends Component { fetchData() { Report.fetchIOUReportByID(this.props.route.params.iouReportID, this.props.route.params.chatReportID, true); + API.read('OpenRequestCallPage'); } /** From 4171bcb1e19d7f3f3c398c39e61d59579f41dcd4 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Thu, 14 Jul 2022 09:22:47 +0100 Subject: [PATCH 2/3] implement new openPaymentDetailsPage API --- src/libs/actions/Report.js | 8 ++++++++ src/pages/iou/IOUDetailsModal.js | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 05924321d313..81d70b859b0e 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1058,6 +1058,13 @@ function openReport(reportID) { }); } +function openPaymentDetailsPage(chatReportID, iouReportID) { + API.read('OpenPaymentDetailsPage', { + reportID: chatReportID, + iouReportID, + }); +} + /** * Marks the new report actions as read * @@ -1575,4 +1582,5 @@ export { markCommentAsUnread, readNewestAction, openReport, + openPaymentDetailsPage, }; diff --git a/src/pages/iou/IOUDetailsModal.js b/src/pages/iou/IOUDetailsModal.js index f152ee11fa50..84ca46ed8321 100644 --- a/src/pages/iou/IOUDetailsModal.js +++ b/src/pages/iou/IOUDetailsModal.js @@ -92,8 +92,7 @@ class IOUDetailsModal extends Component { } fetchData() { - Report.fetchIOUReportByID(this.props.route.params.iouReportID, this.props.route.params.chatReportID, true); - API.read('OpenRequestCallPage'); + Report.openPaymentDetailsPage(this.props.route.params.chatReportID, this.props.route.params.iouReportID); } /** From 203abd9827cd3982b01d6096b6f1bc4a3f406daa Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Thu, 14 Jul 2022 17:36:24 +0100 Subject: [PATCH 3/3] add function doc --- src/libs/actions/Report.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 81d70b859b0e..6e9f4543d5ee 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1058,6 +1058,12 @@ function openReport(reportID) { }); } +/** + * Gets the IOUReport and the associated report actions. + * + * @param {Number} chatReportID + * @param {Number} iouReportID + */ function openPaymentDetailsPage(chatReportID, iouReportID) { API.read('OpenPaymentDetailsPage', { reportID: chatReportID,