Skip to content

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

Make Decimal fields null if no value supplied

dominik-zeglenb3218ef845f5
diff --git a/saleor/static/dashboard-next/products/views/ProductVariantCreate.tsx b/saleor/static/dashboard-next/products/views/ProductVariantCreate.tsx
index 08ab4491fb..335c8014d0 100644
--- a/saleor/static/dashboard-next/products/views/ProductVariantCreate.tsx
+++ b/saleor/static/dashboard-next/products/views/ProductVariantCreate.tsx
@@ -77,8 +77,12 @@ export const ProductVariant: React.StatelessComponent<ProductUpdateProps> = ({
variantCreate({
variables: {
attributes: formData.attributes,
- costPrice: formData.costPrice,
- priceOverride: formData.priceOverride,
+ costPrice: formData.costPrice
+ ? formData.costPrice
+ : null,
+ priceOverride: formData.priceOverride
+ ? formData.priceOverride
+ : null,
product: productId,
quantity: formData.stock,
sku: formData.sku,