Add missing input value, cast values to number (#1692)

This commit is contained in:
Jakub Majorek 2021-12-17 11:16:44 +01:00 committed by GitHub
parent a8c6379d4e
commit 6e9b12b04e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -278,7 +278,7 @@ export const ProductVariant: React.FC<ProductUpdateProps> = ({
id: variantId,
removeStocks: data.removeStocks,
sku: data.sku,
quantityLimitPerCustomer: data.quantityLimitPerCustomer || null,
quantityLimitPerCustomer: Number(data.quantityLimitPerCustomer) || null,
stocks: data.updateStocks.map(mapFormsetStockToStockInput),
trackInventory: data.trackInventory,
preorder: data.isPreorder

View file

@ -119,6 +119,8 @@ export const ProductVariant: React.FC<ProductVariantCreateProps> = ({
})),
trackInventory: true,
weight: weight(formData.weight),
quantityLimitPerCustomer:
Number(formData.quantityLimitPerCustomer) || null,
preorder: formData.isPreorder
? {
globalThreshold: formData.globalThreshold