Custom members area

mport wixData from 'wix-data'; $w.onReady(function () {

function DropdownListUpdate() { let ListofCountry = $w('#ListofCountryDropdown').value let StatesRegion = $w('#StatesRegionDropdown').value let NameofHotel = $w('#NameofHotelDropdown').value let ListUpdate= wixData.query("Listing") if (ListofCountry) {ListUpdate= ListUpdate.eq("listOfCountry",ListofCountry)} if (StatesRegion) {ListUpdate= ListUpdate.eq("statesRegion",StatesRegion)} if (NameofHotel) {ListUpdate= ListUpdate.eq("nameOfHotels", NameofHotel)}

function Options(items) {

return items.map (curr=>{

return {label:curr, value:curr}

})

}

function CountryDropdown() { ListUpdate .limit (1000) .ascending("listOfCountry") .distinct("listOfCountry") .then(results => { let CountryList = Options(results.items); $w('#ListofCountryDropdown').options = CountryList; })

} CountryDropdown()

function StatesRegionDropdown() { ListUpdate .limit (1000) .ascending("statesRegion") .distinct("statesRegion") .then(results => { let StatesRegionList = Options(results.items); $w('#StatesRegionDropdown').options = StatesRegionList ; })

} StatesRegionDropdown()

function HotelsDropdown() { ListUpdate .limit (1000) .ascending("nameOfHotels") .distinct("nameOfHotels") .then(results => { let HotelList = Options(results.items); $w('#NameofHotelDropdown').options = HotelList ; })

} HotelsDropdown()

}

DropdownListUpdate()

$w('#ListofCountryDropdown').onChange(()=>{DropdownListUpdate(); })

$w('#StatesRegionDropdown').onChange(()=>{DropdownListUpdate(); })

$w('#NameofHotelDropdown').onChange(()=>{DropdownListUpdate(); })

}