Skip to content

Commit 51d6ebe

Browse files
authored
Merge pull request #1972 from appwrite/fix-apply-credit-payment-method
fix: refresh payment methods after user adds a payment method
2 parents b380583 + d995672 commit 51d6ebe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/routes/(console)/apply-credit/+page.svelte

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,14 @@
255255
})();
256256
}
257257
}
258+
259+
// after adding a payment method, fetch the payment methods again so the input can be updated
260+
$: if (
261+
paymentMethodId &&
262+
!methods?.paymentMethods?.find((method) => method.$id === paymentMethodId)
263+
) {
264+
loadPaymentMethods();
265+
}
258266
</script>
259267

260268
<svelte:head>

0 commit comments

Comments
 (0)