File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed
routes/(console)/organization-[organization]/change-plan Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 21
21
try {
22
22
const card = await submitStripeCard (name , page ?.params ?.organization ?? null );
23
23
modal .closeModal ();
24
- invalidate (Dependencies .PAYMENT_METHODS );
24
+ await invalidate (Dependencies .PAYMENT_METHODS );
25
25
dispatch (' submit' , card );
26
26
addNotification ({
27
27
type: ' success' ,
Original file line number Diff line number Diff line change 20
20
21
21
async function cardSaved(event : CustomEvent <PaymentMethodData >) {
22
22
value = event .detail .$id ;
23
- invalidate (Dependencies .UPGRADE_PLAN );
24
- invalidate (Dependencies .CREATE_ORGANIZATION );
23
+
24
+ if (value ) {
25
+ methods = {
26
+ ... methods ,
27
+ total: methods .total + 1 ,
28
+ paymentMethods: [... methods .paymentMethods , event .detail ]
29
+ };
30
+ }
31
+
32
+ await Promise .all ([
33
+ invalidate (Dependencies .UPGRADE_PLAN ),
34
+ invalidate (Dependencies .CREATE_ORGANIZATION )
35
+ ]);
25
36
}
26
37
27
38
onMount (() => {
Original file line number Diff line number Diff line change 338
338
</Layout .Stack >
339
339
</Layout .Stack >
340
340
</Fieldset >
341
- {:then paymentMethods }
341
+ {:then _ }
342
342
<Fieldset legend =" Payment" >
343
343
<SelectPaymentMethod
344
- methods ={ paymentMethods }
344
+ bind:taxId
345
345
bind:value ={paymentMethodId }
346
- bind:taxId >
346
+ bind:methods ={ paymentMethods } >
347
347
<svelte:fragment slot =" actions" >
348
348
{#if ! selectedCoupon ?.code }
349
349
{#if paymentMethodId }
You can’t perform that action at this time.
0 commit comments