Dropdown independent

my bad… Now it works for dropdown 1 alone and dropdown 2 alone but not when I select something in both whereas before only this configuration worked…

function search ( ) {

if ( $w ( “#dropdown1” ). value ) {
// Query ‘Origin’ only when #dropdown1 is filled
wixData . query ( “VideoAll” )
. eq ( “origin” , String ( $w ( “#dropdown1” ). value ))
. find ()
. then ( results => {
$w ( “#Badgerepeater” ). data = results . items ;
})

} else if ( $w ( “#dropdown2” ). value ) {
// Query ‘classification’ only when #dropdown2 is filled
wixData . query ( “VideoAll” )
. eq ( “classification” , String ( $w ( “#dropdown2” ). value ))
. find ()
. then ( results => {
$w ( “#Badgerepeater” ). data = results . items ;
})

} else {
// Query for both. You can use your original code on here
wixData . query ( “VideoAll” )
. eq ( “origin” , String ( $w ( “#dropdown1” ). value ))
. and ( wixData . query ( “VideoAll” ). contains ( “classification” , String ( $w ( “#dropdown2” ). value )))
. find ()
. then ( results => {
$w ( “#Badgerepeater” ). data = results . items ;
});

}}