Merge pull request #271 from mirumee/fix/voucher-limit
Fix voucher limit
This commit is contained in:
commit
01b6193b3e
3 changed files with 5 additions and 6 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue