I’m having a little trouble with something that I’m trying to do.
I currently have a database containing a list of articles owned by my site’s members. I want to filter this articles by name and by user logged in and I can’t do it. Am using a text box to filter the data. Could someone tell me what I’m doing wrong?
import wixData from ‘wix-data’ ;
import wixUsers from ‘wix-users’ ;
$w.onReady( function () {
//TODO: write your page related code here…
});
export function SearchBar_keyPress(event) {
let user = wixUsers.currentUser;
let email = user.getEmail()
let userEmail = email;
wixData.query( “Resultados” )
.eq( “correo” , email)
.find()
.then(() => {
$w( "#dataset2" ).setFilter(wixData.filter()
.contains( "title" , $w( '#SearchBar' ).value)
)
.then(() => {
console.log( "Dataset is filtered" );
})
. **catch** ((err) => {
console.log(err);
});
});
}
Thanks a lot for your help