So, I put the code in, but the message does not work. Here is my code:
import wixData from 'wix-data';
let user = wixUsers.currentUser;
user.getEmail()
.then( (email) => {
let userEmail = email; // "user@something.com"
wixData.query('contactInfo')
.eq('#email', userEmail)
.find()
.then((res) => {
if(res) {
console.log('Duplicate user found, returning');
//below is error messages to show
$w('#error').show();
$w('#erroBig').show();
$w('#errorText').show();
$w('#errorBubble').show();
}
else {
wixData.insert("contactInfo",userEmail)
}
//insert to collection here (no duplicate found)
})
} );