mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #1906 from appwrite/fix-create-org-payment-flow
fix: create organization payment methods not updating
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
async function cardSaved(event: CustomEvent<PaymentMethodData>) {
|
||||
value = event.detail.$id;
|
||||
invalidate(Dependencies.UPGRADE_PLAN);
|
||||
invalidate(Dependencies.CREATE_ORGANIZATION);
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
|
||||
@@ -18,6 +18,7 @@ export enum Dependencies {
|
||||
INVOICES = 'dependency:invoices',
|
||||
ADDRESS = 'dependency:address',
|
||||
UPGRADE_PLAN = 'dependency:upgrade_plan',
|
||||
CREATE_ORGANIZATION = 'dependency:create_organization',
|
||||
PAYMENT_METHODS = 'dependency:paymentMethods',
|
||||
ORGANIZATION = 'dependency:organization',
|
||||
MEMBERS = 'dependency:members',
|
||||
|
||||
@@ -213,20 +213,29 @@
|
||||
</Fieldset>
|
||||
{#if selectedPlan !== BillingPlan.FREE}
|
||||
<Fieldset legend="Payment">
|
||||
<SelectPaymentMethod
|
||||
methods={data.paymentMethods}
|
||||
bind:value={paymentMethodId}
|
||||
bind:taxId>
|
||||
<svelte:fragment slot="actions">
|
||||
{#if !selectedCoupon?.code}
|
||||
<Divider vertical style="height: 2rem;" />
|
||||
<Button compact on:click={() => (showCreditModal = true)}>
|
||||
<Icon icon={IconPlus} slot="start" size="s" />
|
||||
Add credits
|
||||
</Button>
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
</SelectPaymentMethod>
|
||||
<Layout.Stack gap="s" alignItems="flex-start">
|
||||
<SelectPaymentMethod
|
||||
methods={data.paymentMethods}
|
||||
bind:value={paymentMethodId}
|
||||
bind:taxId>
|
||||
<svelte:fragment slot="actions">
|
||||
{#if !selectedCoupon?.code && paymentMethodId}
|
||||
<Divider vertical style="height: 2rem;" />
|
||||
<Button compact on:click={() => (showCreditModal = true)}>
|
||||
<Icon icon={IconPlus} slot="start" size="s" />
|
||||
Add credits
|
||||
</Button>
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
</SelectPaymentMethod>
|
||||
|
||||
{#if !selectedCoupon?.code && !paymentMethodId}
|
||||
<Button compact on:click={() => (showCreditModal = true)}>
|
||||
<Icon icon={IconPlus} slot="start" size="s" />
|
||||
Add credits
|
||||
</Button>
|
||||
{/if}
|
||||
</Layout.Stack>
|
||||
</Fieldset>
|
||||
<Fieldset legend="Invite members">
|
||||
<InputTags
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { BillingPlan } from '$lib/constants';
|
||||
import { BillingPlan, Dependencies } from '$lib/constants';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
import type { Coupon } from '$lib/sdk/billing';
|
||||
import type { Organization } from '$lib/stores/organization';
|
||||
|
||||
export const load: PageLoad = async ({ url, parent }) => {
|
||||
export const load: PageLoad = async ({ url, parent, depends }) => {
|
||||
depends(Dependencies.CREATE_ORGANIZATION);
|
||||
const { organizations } = await parent();
|
||||
const [coupon, paymentMethods] = await Promise.all([
|
||||
getCoupon(url),
|
||||
|
||||
Reference in New Issue
Block a user