From 89aa2973fa8363c70928787102e47206c6574cc5 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 19 Mar 2025 09:39:05 +0100 Subject: [PATCH] Close modal, and don't apply coupon --- src/lib/components/billing/validateCreditModal.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/components/billing/validateCreditModal.svelte b/src/lib/components/billing/validateCreditModal.svelte index c9c926577..ebdf09acb 100644 --- a/src/lib/components/billing/validateCreditModal.svelte +++ b/src/lib/components/billing/validateCreditModal.svelte @@ -20,13 +20,15 @@ async function addCoupon() { try { const response = await sdk.forConsole.billing.getCoupon(coupon); - couponData = response; + if (response.onlyNewOrgs && !isNewOrg) { + show = false; addNotification({ type: 'error', message: 'Coupon only valid for new organizations' }); } else { + couponData = response; dispatch('validation', couponData); coupon = null; show = false;