Added option to include-exclude ads without price

This commit is contained in:
Naida Vatric
2020-01-23 11:13:53 +01:00
parent 5b3491fdba
commit 98263364c7
2 changed files with 45 additions and 19 deletions

View File

@@ -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 = {};