From c23981f356955909fdfe89e15639151758d90cd4 Mon Sep 17 00:00:00 2001 From: Kosuke Tseng Date: Sat, 30 Jul 2022 15:42:07 -0700 Subject: [PATCH 1/2] Add openpayments command --- src/libs/actions/PaymentMethods.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/libs/actions/PaymentMethods.js b/src/libs/actions/PaymentMethods.js index dc9ad432fd56..ddfd69f26d06 100644 --- a/src/libs/actions/PaymentMethods.js +++ b/src/libs/actions/PaymentMethods.js @@ -103,6 +103,34 @@ function getPaymentMethods() { }); } +function openPaymentsPage() { + const onyxData = { + optimisticData: [ + { + onyxMethod: 'merge', + key: ONYXKEYS.IS_LOADING_PAYMENT_METHODS, + value: true, + }, + ], + successData: [ + { + onyxMethod: 'merge', + key: ONYXKEYS.IS_LOADING_PAYMENT_METHODS, + value: false, + }, + ], + failureData: [ + { + onyxMethod: 'merge', + key: ONYXKEYS.IS_LOADING_PAYMENT_METHODS, + value: false, + }, + ], + }; + + return API.read('OpenPaymentsPage', {}, onyxData); +} + /** * Sets the default bank account or debit card for an Expensify Wallet * @@ -288,6 +316,7 @@ export { deleteDebitCard, deletePayPalMe, getPaymentMethods, + openPaymentsPage, makeDefaultPaymentMethod, addBillingCard, kycWallRef, From 5fb645d63f4580db2bde0732c39592afbbe089cc Mon Sep 17 00:00:00 2001 From: Kosuke Tseng Date: Sat, 30 Jul 2022 15:42:17 -0700 Subject: [PATCH 2/2] use new command --- src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js b/src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js index 56f39910e421..6b49dca8356f 100644 --- a/src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js +++ b/src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js @@ -201,7 +201,7 @@ class BasePaymentsPage extends React.Component { } fetchData() { - PaymentMethods.getPaymentMethods(); + PaymentMethods.openPaymentsPage(); } /**