From 26909ba5a71cde844f282a2e01fce75429fcbf41 Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 14 Nov 2023 14:13:28 +0700 Subject: [PATCH 1/3] update optimistic data --- src/libs/actions/IOU.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index aa07f0e7ca34..4d0580624a6a 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -2425,7 +2425,7 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType function getPayMoneyRequestParams(chatReport, iouReport, recipient, paymentMethodType) { const optimisticIOUReportAction = ReportUtils.buildOptimisticIOUReportAction( CONST.IOU.REPORT_ACTION_TYPE.PAY, - iouReport.total, + iouReport.total * -1, iouReport.currency, '', [recipient], From 6fafef5131171281702b00a807707667b3df9e0f Mon Sep 17 00:00:00 2001 From: Dylan Date: Wed, 15 Nov 2023 11:20:48 +0700 Subject: [PATCH 2/3] update UTs --- tests/actions/IOUTest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/actions/IOUTest.js b/tests/actions/IOUTest.js index 1c258f6e0f37..ad73a026ff08 100644 --- a/tests/actions/IOUTest.js +++ b/tests/actions/IOUTest.js @@ -1757,7 +1757,7 @@ describe('actions/IOU', () => { }), ]), originalMessage: expect.objectContaining({ - amount, + amount: amount * -1, paymentType: CONST.IOU.PAYMENT_TYPE.VBBA, type: 'pay', }), From 36c3c239e82cf1eb3b8b2dd253ae944df3cae395 Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 21 Nov 2023 09:47:50 +0700 Subject: [PATCH 3/3] using negative sign --- src/libs/actions/IOU.js | 2 +- tests/actions/IOUTest.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index 4d0580624a6a..fd16dd0c5eab 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -2425,7 +2425,7 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType function getPayMoneyRequestParams(chatReport, iouReport, recipient, paymentMethodType) { const optimisticIOUReportAction = ReportUtils.buildOptimisticIOUReportAction( CONST.IOU.REPORT_ACTION_TYPE.PAY, - iouReport.total * -1, + -iouReport.total, iouReport.currency, '', [recipient], diff --git a/tests/actions/IOUTest.js b/tests/actions/IOUTest.js index ad73a026ff08..ed916a7d6fe2 100644 --- a/tests/actions/IOUTest.js +++ b/tests/actions/IOUTest.js @@ -1757,7 +1757,7 @@ describe('actions/IOU', () => { }), ]), originalMessage: expect.objectContaining({ - amount: amount * -1, + amount: -amount, paymentType: CONST.IOU.PAYMENT_TYPE.VBBA, type: 'pay', }),