From d15c2408df2beeeecbce0f72a3911c003210ff11 Mon Sep 17 00:00:00 2001 From: Fringg Date: Wed, 15 Apr 2026 04:13:53 +0300 Subject: [PATCH] fix: always send period_discounts in promo group updates When all period discounts were removed, the frontend sent undefined (field absent from JSON), so the backend never cleared them. Now always sends the field - empty object {} to clear, or populated object to update. --- src/pages/AdminPromoGroupCreate.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/AdminPromoGroupCreate.tsx b/src/pages/AdminPromoGroupCreate.tsx index 7c3abc7..11d7416 100644 --- a/src/pages/AdminPromoGroupCreate.tsx +++ b/src/pages/AdminPromoGroupCreate.tsx @@ -150,8 +150,7 @@ export default function AdminPromoGroupCreate() { server_discount_percent: serverVal, traffic_discount_percent: trafficVal, device_discount_percent: deviceVal, - period_discounts: - Object.keys(periodDiscountsRecord).length > 0 ? periodDiscountsRecord : undefined, + period_discounts: periodDiscountsRecord, apply_discounts_to_addons: applyToAddons, auto_assign_total_spent_kopeks: autoAssignVal > 0 ? Math.round(autoAssignVal * 100) : 0, is_default: isDefault,