ASC.People: ProfileAction: added simple email validation
This commit is contained in:
parent
8f76138886
commit
e3f341c032
@ -80,10 +80,11 @@ class CreateUserForm extends React.Component {
|
||||
}
|
||||
|
||||
validate() {
|
||||
const emailRegex = /.+@.+\..+/;
|
||||
const errors = {
|
||||
firstName: !this.state.profile.firstName,
|
||||
lastName: !this.state.profile.lastName,
|
||||
email: !this.state.profile.email,
|
||||
email: !emailRegex.test(this.state.profile.email),
|
||||
password: this.state.profile.passwordType === "temp" && !this.state.profile.password
|
||||
};
|
||||
const hasError = errors.firstName || errors.lastName || errors.email || errors.password;
|
||||
|
@ -76,10 +76,11 @@ class UpdateUserForm extends React.Component {
|
||||
}
|
||||
|
||||
validate() {
|
||||
const emailRegex = /.+@.+\..+/;
|
||||
const errors = {
|
||||
firstName: !this.state.profile.firstName,
|
||||
lastName: !this.state.profile.lastName,
|
||||
email: !this.state.profile.email,
|
||||
email: !emailRegex.test(this.state.profile.email),
|
||||
password: this.state.profile.passwordType === "temp" && !this.state.profile.password
|
||||
};
|
||||
const hasError = errors.firstName || errors.lastName || errors.email || errors.password;
|
||||
|
Loading…
Reference in New Issue
Block a user