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

This commit is contained in:
Frane Polić
2025-10-19 10:40:20 +02:00
committed by GitHub
parent 441e5e4710
commit 2d45ba7be1
2 changed files with 10 additions and 7 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/draft-order": patch
---
fix(draft-order): email reset when changing customer

View File

@@ -322,12 +322,10 @@ const CustomerField = ({ control, setValue }: CustomerFieldProps) => {
const customerEmail = label?.match(/\((.*@.*)\)$/)?.[1] || label
if (!email && customerEmail) {
setValue("email", customerEmail, {
setValue("email", customerEmail || "", {
shouldDirty: true,
shouldTouch: true,
})
}
},
[email, setValue, customers.options]
)