fix(admin): draft order shipping details (#3500)

* wip: fix draft order shipping details screen

* fix: reset address, refactor and cleanup

* fix: use const

* Create .changeset/violet-sloths-train.md

* fix: required fields, reset province

---------

Co-authored-by: fPolic <frane@medusajs.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Frane Polić
2023-03-19 14:31:03 +01:00
committed by GitHub
parent aed7805c0e
commit a3a7ace0c0
3 changed files with 48 additions and 29 deletions

View File

@@ -0,0 +1,9 @@
const EMAIL_REGEX =
/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
/**
* Validate if provided string could be an email
*/
export function isValidEmail(email: string) {
return email?.match(EMAIL_REGEX)
}