fix(draft-order): email reset when changing customer (#13771)
This commit is contained in:
@@ -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]
|
||||
)
|
||||
@@ -777,4 +775,4 @@ const schema = z
|
||||
}
|
||||
})
|
||||
|
||||
export default Create
|
||||
export default Create
|
||||
|
||||
Reference in New Issue
Block a user