From 3a865a472b60d3f85d68fa4a6adc935b6838b5fa Mon Sep 17 00:00:00 2001 From: Fringg Date: Wed, 15 Apr 2026 03:40:09 +0300 Subject: [PATCH] fix: allow saving 0% period discount in promo groups Changed condition from percent > 0 to percent >= 0 so that admins can explicitly set 0% discount for a period. Previously 0% entries were silently dropped and not sent to the backend. --- src/pages/AdminPromoGroupCreate.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/AdminPromoGroupCreate.tsx b/src/pages/AdminPromoGroupCreate.tsx index a9ee620..7c3abc7 100644 --- a/src/pages/AdminPromoGroupCreate.tsx +++ b/src/pages/AdminPromoGroupCreate.tsx @@ -135,7 +135,7 @@ export default function AdminPromoGroupCreate() { periodDiscounts.forEach((pd) => { const days = pd.days === '' ? 0 : pd.days; const percent = pd.percent === '' ? 0 : pd.percent; - if (days > 0 && percent > 0) { + if (days > 0 && percent >= 0) { periodDiscountsRecord[days] = percent; } });