Merge pull request #271 from mirumee/fix/voucher-limit

Fix voucher limit
This commit is contained in:
Marcin Gębala 2019-11-27 09:57:53 +01:00 committed by GitHub
commit 01b6193b3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View file

@ -14,6 +14,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Improve mobile appearance - #240 by @benekex2 and @dominik-zeglen - Improve mobile appearance - #240 by @benekex2 and @dominik-zeglen
- Use searches as hooks instead of components - #262 by @dominik-zeglen - Use searches as hooks instead of components - #262 by @dominik-zeglen
- Add navigator - #267 by @dominik-zeglen - Add navigator - #267 by @dominik-zeglen
- Fix voucher limit - #271 by @dominik-zeglen
## 2.0.0 ## 2.0.0

View file

@ -220,11 +220,9 @@ const VoucherList: React.FC<VoucherListProps> = props => {
)} )}
</TableCell> </TableCell>
<TableCell className={classes.colUses}> <TableCell className={classes.colUses}>
{voucher && voucher.usageLimit ? ( {maybe<React.ReactNode>(
voucher.usageLimit () =>
) : voucher && voucher.usageLimit === null ? ( voucher.usageLimit === null ? "-" : voucher.usageLimit,
"-"
) : (
<Skeleton /> <Skeleton />
)} )}
</TableCell> </TableCell>

View file

@ -381,7 +381,7 @@ export const VoucherDetails: React.FC<VoucherDetailsProps> = ({
: formData.type, : formData.type,
usageLimit: formData.hasUsageLimit usageLimit: formData.hasUsageLimit
? parseInt(formData.usageLimit, 10) ? parseInt(formData.usageLimit, 10)
: 0 : null
} }
} }
}) })