frontend: email optional

This commit is contained in:
realaravinth
2021-04-12 11:21:02 +05:30
parent d32350e2b6
commit 420ff75817
3 changed files with 11 additions and 10 deletions

View File

@@ -20,17 +20,19 @@ const registerUser = async e => {
return alert("passwords don't match, check again!");
}
let email = document.getElementById('email').value;
isBlankString(e, email, 'email');
let exists = await userExists();
if (exists) {
return;
}
exists = await checkEmailExists();
if (exists) {
return;
let email = document.getElementById('email').value;
if (!email.replace(/\s/g, '').length) {
email = null;
} else {
exists = await checkEmailExists();
if (exists) {
return;
}
}
let payload = {
@@ -54,4 +56,4 @@ export const index = () => {
let username = document.getElementById('username');
username.addEventListener('input', userExists, false);
}
};