Looking to filter by dropdown then checkbox

I have just recently starting building my website and am looking for how to combine my code. What I have is a database with location tags (by state) and tags for what each location offers). I currently have the code working, however, when I drop down by location, it gives me the state with the correct result, but if I use the checkbox filter, then it gives me different places with all of those tags regardless of the state location. Can someone help me with this?

The goal is to use the dropdown filter, then once the location shows… I want to be able to filter by category like “outdoor seating”, “pet friendly” and it show the correct info by state.

Here is the code:
//code for the dropdown
import wixData from ‘wix-data’ ;

$w . onReady (() => {
$w ( “#dropdown3” ). onChange ( function () {
search ();
});
});

function search ( ) {

wixData . query ( "Breweries" ) 
    . contains ( "locations" ,  String ( $w ( "#dropdown3" ). value )) 
    
    . find () 
    . then ( results  => { 
        $w ( "#listRepeater" ). data  =  results . items ; 

        
    }); 

}
//code for checkbox
const databaseName = ‘Breweries’ ;
const databaseField = ‘tags’ ;

$w . onReady ( function () {

$w ( '#selectionTags1' ). onChange (( event ) => { 
    **const**  selectedBox  =  $w ( '#selectionTags1' ). value ; 
    addItemstoRepeater ( selectedBox ); 
}) 

});

function addItemstoRepeater ( selectedOption = []) {

**let**  dataQuery  =  wixData . query ( databaseName ); 

**if**  ( selectedOption . length  >  0 ) { 
    dataQuery  =  dataQuery . hasSome ( databaseField ,  selectedOption ); 
} 

dataQuery 
    . find () 
    . then ( results  => { 
        **const**  filtereditemsReady  =  results . items ; 
        $w ( '#listRepeater' ). data  =  filtereditemsReady ; 

    }) 

}

Well, first of all…

a → selectionTags-element is not a checkBox!
And a checkbox-group is also different than a normal single checkbox and behaves different.

So which element you wanna use for your project?

  1. Checkbox? Where it will be located? → inside or outside of a repeater?
  2. Checkbox-group?
  3. selectionTag-element?

Just some days ago, i provided a code somehere in of of the numerous posts, which can handle all 3 mentioned elements.

Maybe i can find the post one more time for you…

In the meanwhile…