Skip to content

Commit f4d7128

Browse files
author
Myztiq
committed
We now update the whitelists model when the payment method is added so we know it's been refreshed in the UI.
1 parent 209efe8 commit f4d7128

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

client/directives/modals/settingsModal/forms/billingForm/changePaymentForm/changePaymentFormController.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ require('app')
66
function ChangePaymentFormController(
77
$rootScope,
88
currentOrg,
9+
errs,
910
fetchPaymentMethod,
11+
fetchPlan,
12+
fetchWhitelists,
1013
loading,
1114
savePaymentMethod,
12-
stripe,
13-
fetchPlan
15+
stripe
1416
) {
1517
var CPFC = this;
1618
CPFC.currentOrg = currentOrg;
@@ -44,6 +46,9 @@ function ChangePaymentFormController(
4446
.then(function (res) {
4547
return savePaymentMethod(res.id);
4648
})
49+
.then(function () {
50+
return fetchWhitelists();
51+
})
4752
.then(function () {
4853
// Not doing an angular timeout because we don't care about the digest.
4954
// We want to wait for this form to no longer be visible before we clear it and cause error outlines to show.
@@ -60,6 +65,9 @@ function ChangePaymentFormController(
6065
} else {
6166
CPFC.error = messageConversion[err.type];
6267
}
68+
if (!CPFC.error) {
69+
errs.handler(err);
70+
}
6371
})
6472
.finally(function () {
6573
loading('savePayment', false);

0 commit comments

Comments
 (0)