Added option to include-exclude ads without price
This commit is contained in:
@@ -57,7 +57,8 @@ const findSearchRequestsForRealEstate = async realEstate => {
|
||||
|
||||
//Attributes are checked separately to make different query parts
|
||||
|
||||
//If price is null it will be excluded from query - it will show properties with null price values
|
||||
//If real estate price is number then it searches for req that have priceMin and priceMax
|
||||
//If real estate price is null it searches for req that accept ads without price
|
||||
//User always defines price and area (sliders) - not null in search req
|
||||
let priceQuery = {};
|
||||
if (price != null) {
|
||||
@@ -75,6 +76,12 @@ const findSearchRequestsForRealEstate = async realEstate => {
|
||||
}
|
||||
]
|
||||
};
|
||||
} else {
|
||||
priceQuery = {
|
||||
includeWithoutPrice: {
|
||||
[Op.eq]: true
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
let areaQuery = {};
|
||||
|
||||
Reference in New Issue
Block a user