I’m querying a collection for duplicate email address. If no duplicate is found, expand box A. If duplicate found, expand box B.
Finding a duplicate and expanding box A works fine, but when no duplicate is found, nothing happens. I cannot work out what is wrong with my code that would cause this?
export function emailCheck_click(event) {
let enteredEmail = $w("#emailtoVerify").value;
let formattedEmail = (enteredEmail).toLowerCase();
wixData.query("regClients")
.eq("registerEmail", (formattedEmail))
.find()
.then((results) => {
if(results.items.length > 0) {
$w("#verifyError").expand();
}
else {
$w("#registerForm").expand;
}
})
}
Any advice would be appreciated.