Wix Data Filter with repeater

Can anyone tell me what is wrong with my code? I have created the below code using a step by step tutorial. I have created my two drop down search boxes with a submit button. 1 drop down for vendor category. 1 drop down for city& state. The goal is to have the user choose the vendor category, next select city& state, then hit the submit button. No dataset is connected to the drop down as this is the way of the tutorial. I am filtering my repeater. I am getting an error with this code }); at the end.

import wixData from ‘wix-data’;

$w.onReady( function () {
//TODO: write your page related code here…

});
export function searchbutton_click(event, $w) {
$w(“#dataset2”).setFilter(wixData.filter()

    .contains("category",$w('#vendordropdown').value) 
    .contains("cityState",$w('#cityandstatedropdown').value) 

.then((results) => { 
      console.log("Dataset is now filtered"); 
      $w('#Vendorlist').data = results.items; 
    }). **catch** ((err) => { 
        console.log(err); 
    });  <----------------------------- ERROR 
$w("#Vendorlist").expand(); 

}

Hi Eb,

Yes. You are just missing a closing “)” before the “.then”.

   $w("#dataset2").setFilter(wixData.filter()

        .contains("category",$w('#vendordropdown').value)
        .contains("cityState",$w('#cityandstatedropdown').value)
    )  // <-- added this ")"
    .then((results) => {
          console.log("Dataset is now filtered");
          $w('#Vendorlist').data = results.items;
        }).catch((err) => {
            console.log(err);
        }); // <----------------------------- NO MORE ERROR

    $w("#Vendorlist").expand();

Hope this works for you.

Nick

Yes it worked. Thank you for your time.