address comments: fix checks.

This commit is contained in:
Darshan committed 2025-02-13 17:48:46 +05:30
1 parent c5483b6c7f
commit dc40c6b87a
1 file changed
+2 -7
@@ -95,19 +95,14 @@
async function handleSubmit() {
if (couponData) {
if (
selectedOrg?.billingPlan === BillingPlan.PRO &&
campaign.plan !== BillingPlan.SCALE
) {
if (!campaign?.plan || campaign.plan === selectedOrg?.billingPlan) {
await applyCouponCredit(selectedOrg);
return;
}
const createOrganization = selectedAction === 'create';
const isScalePlanUpgrade =
selectedOrg &&
(selectedOrg?.billingPlan as Tier) === BillingPlan.PRO &&
campaign?.plan === BillingPlan.SCALE;
campaign?.plan && selectedOrg?.billingPlan !== campaign?.plan;
// on create-org, its `coupon`
if (createOrganization) {