$w.onReady( function() {
let userEmail = wixUsers.currentUser.getEmail();
wixData.query(“Members”)
.contains(“email”, userEmail )
.find()
.then( (results) => { console.log(results); } )
// gestione dell’errore
.catch( (err) => { console.log(err); } );
} );
Hi,
I’am in case a member’s just logged in and I would, querying the database particulary the field “email”, do consequentially something
If member logged is Mauro => do something_1
If member logged is Francesco => do something_2
So to debug my code I put the console.log(results) in order to verify the behavior, but the output is:
« Error: Failed to perform query on [Members].
Invalid .contains parameter value [Promise]. .contains parameter must be a String. »
In what am I wrong ?
I have to say that it’s few time I’m learnig Javascript in order to manage Wix Code
Thanks in advance
Mauro