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.
This commit is contained in:
Fringg
2026-04-15 03:40:09 +03:00
parent c80e1aff75
commit 3a865a472b

View File

@@ -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;
}
});