diff --git a/.changeset/fresh-windows-lay.md b/.changeset/fresh-windows-lay.md new file mode 100644 index 0000000000..0bfe93d115 --- /dev/null +++ b/.changeset/fresh-windows-lay.md @@ -0,0 +1,5 @@ +--- +"@medusajs/dashboard": patch +--- + +fix(dashboard): product create trim inputs diff --git a/packages/admin/dashboard/src/routes/products/product-create/utils.ts b/packages/admin/dashboard/src/routes/products/product-create/utils.ts index d2f8ad59ae..848e7c67b3 100644 --- a/packages/admin/dashboard/src/routes/products/product-create/utils.ts +++ b/packages/admin/dashboard/src/routes/products/product-create/utils.ts @@ -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,