From 7f70864ffb09a618905a4a470b209991d968a415 Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Tue, 26 Nov 2019 15:44:02 +0100 Subject: [PATCH 1/3] Send null instead of 0 --- src/discounts/views/VoucherDetails.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/discounts/views/VoucherDetails.tsx b/src/discounts/views/VoucherDetails.tsx index 8bf6fe9b3..005120de2 100644 --- a/src/discounts/views/VoucherDetails.tsx +++ b/src/discounts/views/VoucherDetails.tsx @@ -381,7 +381,7 @@ export const VoucherDetails: React.FC = ({ : formData.type, usageLimit: formData.hasUsageLimit ? parseInt(formData.usageLimit, 10) - : 0 + : null } } }) From 7c6ef4d41d095025d1f654e6ef5034e1dd2ef9a7 Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Tue, 26 Nov 2019 15:49:39 +0100 Subject: [PATCH 2/3] Fix skeleton --- src/discounts/components/VoucherList/VoucherList.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/discounts/components/VoucherList/VoucherList.tsx b/src/discounts/components/VoucherList/VoucherList.tsx index 45afba2d3..83e2e4382 100644 --- a/src/discounts/components/VoucherList/VoucherList.tsx +++ b/src/discounts/components/VoucherList/VoucherList.tsx @@ -220,11 +220,9 @@ const VoucherList: React.FC = props => { )} - {voucher && voucher.usageLimit ? ( - voucher.usageLimit - ) : voucher && voucher.usageLimit === null ? ( - "-" - ) : ( + {maybe( + () => + voucher.usageLimit === null ? "-" : voucher.usageLimit, )} From d0a7b2eabe2b4b61585d94d7629e0a9cf17a2272 Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Tue, 26 Nov 2019 16:02:11 +0100 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc36edc03..bad2ea38f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ All notable, unreleased changes to this project will be documented in this file. - Fix disappearing products description - #259 by @dominik-zeglen - Improve mobile appearance - #240 by @benekex2 and @dominik-zeglen - Use searches as hooks instead of components - #262 by @dominik-zeglen +- Fix voucher limit - #271 by @dominik-zeglen ## 2.0.0