Hi Everyone,
This is my very first time learning wix code and it took me 4 days research and watching many videos to created the code as seen in a video most similar to my needs.
The goal is to build a real estate search filter that will allow for selections of a few options such as property type, price no. of bedrooms, location etc as seen in pic.
However code does not work, when in search nothing comes up, this error code shows
Error: Failed to perform query on [RealEstate].
$gte should be a Date, Number, or String. Got null instead
$lt should be a Date, Number, or String. Got null instead
below is my code
import wixData from ‘wix-data’;
export function searchbotton_click(event) {
$w(‘#dataset1’).setFilter(wixData.filter()
.contains("propertyType", $w('#droptype').value)
.contains("status", $w('#dropstatus').value)
.contains("location", $w('#droplocation').value)
.ge("bedrooms", $w('#dropbedrooms').value)
.between("priceBaht", parseFloat($w('#droppricefrom').value), parseFloat($w('#droppriceto').value)))
.then((results) => {
console.log("Data Set is now Filtered");
$w('#repeater1').data = results.items;
}). catch ((err) => {
console.log(err);
});
$w('#repeater1').expand()
}
(I seem to know what i’m doing up until the .then ((results)), which i copy off from WiX Data Filters - YouTube
Please help fix, Thank you