mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-22 07:52:43 +00:00
Use includes instead of indexOf
This commit is contained in:
parent
03535246a4
commit
5dbd259e01
2 changed files with 2 additions and 5 deletions
|
@ -92,10 +92,7 @@
|
|||
};
|
||||
rules = {
|
||||
required: value => !!value || 'Required.',
|
||||
email: (value) => {
|
||||
const pattern = /^(([^<>()[\]\\.,;:\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,}))$/;
|
||||
return pattern.test(value) || 'Invalid e-mail.';
|
||||
},
|
||||
email: (value) => value.includes('@') || 'Invalid e-mail.',
|
||||
};
|
||||
user: any;
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
rules = {
|
||||
password_length: value => value.length > 6 || 'Password must be at least 6 characters long',
|
||||
required: value => !!value || 'Required.',
|
||||
email: (value: string) => value.indexOf('@') !== -1 || 'Invalid e-mail.',
|
||||
email: (value: string) => value.includes('@') || 'Invalid e-mail.',
|
||||
};
|
||||
|
||||
resetState() {
|
||||
|
|
Loading…
Reference in a new issue