mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
address comments: fix checks.
This commit is contained in:
1 parent
dc40c6b87a
commit
4ea403ef60
1 file changed
+4
-7
@@ -17,11 +17,9 @@
|
||||
import { onMount } from 'svelte';
|
||||
import { writable } from 'svelte/store';
|
||||
import { CreditsApplied } from '$lib/components/billing';
|
||||
import { BillingPlan } from '$lib/constants';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
||||
import { Helper } from '$lib/elements/forms/index.js';
|
||||
import type { Tier } from '$lib/stores/billing';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -95,11 +93,6 @@
|
||||
|
||||
async function handleSubmit() {
|
||||
if (couponData) {
|
||||
if (!campaign?.plan || campaign.plan === selectedOrg?.billingPlan) {
|
||||
await applyCouponCredit(selectedOrg);
|
||||
return;
|
||||
}
|
||||
|
||||
const createOrganization = selectedAction === 'create';
|
||||
const isScalePlanUpgrade =
|
||||
campaign?.plan && selectedOrg?.billingPlan !== campaign?.plan;
|
||||
@@ -107,6 +100,10 @@
|
||||
// on create-org, its `coupon`
|
||||
if (createOrganization) {
|
||||
await goto(`${base}/create-organization?coupon=${couponData.code}`);
|
||||
return;
|
||||
}
|
||||
if (!campaign?.plan || campaign.plan === selectedOrg?.billingPlan) {
|
||||
await applyCouponCredit(selectedOrg);
|
||||
} else if (isScalePlanUpgrade) {
|
||||
await goto(
|
||||
`${base}/create-organization?coupon=${couponData.code}&plan=${campaign.plan}`
|
||||
|
||||
Reference in new issue
Block a user