fix(draft-order): email reset when changing customer (#13771)

This commit is contained in:
Frane Polić authored and GitHub committed 2025-10-19 10:40:20 +02:00
1 parent 441e5e4710
commit 2d45ba7be1
2 files changed
+9 -6

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/draft-order": patch
---
fix(draft-order): email reset when changing customer
@@ -322,12 +322,10 @@ const CustomerField = ({ control, setValue }: CustomerFieldProps) => {
const customerEmail = label?.match(/\((.*@.*)\)$/)?.[1] || label
if (!email && customerEmail) {
setValue("email", customerEmail, {
shouldDirty: true,
shouldTouch: true,
})
}
setValue("email", customerEmail || "", {
shouldDirty: true,
shouldTouch: true,
})
},
[email, setValue, customers.options]
)