mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
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.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user