Add currency to price filters #78

Merged
RabbIT09-n merged 24 commits from add-currency-to-price-filters into master 2020-01-07 00:09:41 +01:00
2 changed files with 8 additions and 4 deletions
Showing only changes of commit bee390aa15 - Show all commits

View File

@@ -135,8 +135,13 @@ const findRealEstatesForSearchRequest = async (searchRequest, maxResults) => {
adType,
realEstateType,
price: {
[Op.lte]: priceMax,
[Op.gte]: priceMin
[Op.or]: {
[Op.and]: {
[Op.lte]: priceMax,
[Op.gte]: priceMin
},
[Op.is]: null
}
},
area: {
[Op.lte]: sizeMax,

View File

@@ -63,6 +63,7 @@ const findSearchRequestsForRealEstate = async realEstate => {
//Attributes are checked separately and included in query only if defined
//Price and area should be defined for every property
if (price) {
query.priceMin = {
[Op.lte]: price
@@ -70,8 +71,6 @@ const findSearchRequestsForRealEstate = async realEstate => {
query.priceMax = {
[Op.gte]: price
};
} else {
checkForIncompleteWanted = true;
}
if (area) {