Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix clear enddate

Krzysztof Bialoglowicz0f04e9d7066f
diff --git a/saleor/static/dashboard-next/discounts/views/VoucherCreate.tsx b/saleor/static/dashboard-next/discounts/views/VoucherCreate.tsx
index f933cb980a..e2283fbe2c 100644
--- a/saleor/static/dashboard-next/discounts/views/VoucherCreate.tsx
+++ b/saleor/static/dashboard-next/discounts/views/VoucherCreate.tsx
@@ -62,7 +62,9 @@ export const VoucherDetails: React.StatelessComponent = () => {
formData.discountType.toString() === "SHIPPING"
? DiscountValueTypeEnum.PERCENTAGE
: formData.discountType,
- endDate: joinDateTime(formData.endDate, formData.endTime),
+ endDate: formData.hasEndDate
+ ? joinDateTime(formData.endDate, formData.endTime)
+ : null,
minAmountSpent:
formData.minAmountSpent.length > 0
? formData.minAmountSpent.length
diff --git a/saleor/static/dashboard-next/discounts/views/VoucherDetails.tsx b/saleor/static/dashboard-next/discounts/views/VoucherDetails.tsx
index f9992e83ba..7ad4e05ff1 100644
--- a/saleor/static/dashboard-next/discounts/views/VoucherDetails.tsx
+++ b/saleor/static/dashboard-next/discounts/views/VoucherDetails.tsx
@@ -327,10 +327,12 @@ export const VoucherDetails: React.StatelessComponent<VoucherDetailsProps> = ({
"SHIPPING"
? DiscountValueTypeEnum.PERCENTAGE
: formData.discountType,
- endDate: joinDateTime(
- formData.endDate,
- formData.endTime
- ),
+ endDate: formData.hasEndDate
+ ? joinDateTime(
+ formData.endDate,
+ formData.endTime
+ )
+ : null,
minAmountSpent:
formData.minAmountSpent.length > 0
? formData.minAmountSpent