fix(dashboard): trim some product create inputs to prevent creation error (#12004)

* fix: trim some inputs to prevent creation error

* chore: changeset
This commit is contained in:
Frane Polić
2025-03-28 08:59:44 +01:00
committed by GitHub
parent be6a651e2f
commit 3145c5f20d
2 changed files with 9 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/dashboard": patch
---
fix(dashboard): product create trim inputs

View File

@@ -27,15 +27,15 @@ export const normalizeProductFormValues = (
shipping_profile_id: values.shipping_profile_id || undefined,
categories: values.categories.map((id) => ({ id })),
type_id: values.type_id || undefined,
handle: values.handle || undefined,
handle: values.handle?.trim(),
origin_country: values.origin_country || undefined,
material: values.material || undefined,
mid_code: values.mid_code || undefined,
hs_code: values.hs_code || undefined,
thumbnail,
title: values.title,
subtitle: values.subtitle || undefined,
description: values.description || undefined,
title: values.title.trim(),
subtitle: values.subtitle?.trim(),
description: values.description?.trim(),
discountable: values.discountable || undefined,
width: values.width ? parseFloat(values.width) : undefined,
length: values.length ? parseFloat(values.length) : undefined,