RealEstate included even is price is null.
This commit is contained in:
@@ -135,8 +135,13 @@ const findRealEstatesForSearchRequest = async (searchRequest, maxResults) => {
|
|||||||
adType,
|
adType,
|
||||||
realEstateType,
|
realEstateType,
|
||||||
price: {
|
price: {
|
||||||
[Op.lte]: priceMax,
|
[Op.or]: {
|
||||||
[Op.gte]: priceMin
|
[Op.and]: {
|
||||||
|
[Op.lte]: priceMax,
|
||||||
|
[Op.gte]: priceMin
|
||||||
|
},
|
||||||
|
[Op.is]: null
|
||||||
|
}
|
||||||
},
|
},
|
||||||
area: {
|
area: {
|
||||||
[Op.lte]: sizeMax,
|
[Op.lte]: sizeMax,
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ const findSearchRequestsForRealEstate = async realEstate => {
|
|||||||
|
|
||||||
//Attributes are checked separately and included in query only if defined
|
//Attributes are checked separately and included in query only if defined
|
||||||
//Price and area should be defined for every property
|
//Price and area should be defined for every property
|
||||||
|
|
||||||
if (price) {
|
if (price) {
|
||||||
query.priceMin = {
|
query.priceMin = {
|
||||||
[Op.lte]: price
|
[Op.lte]: price
|
||||||
@@ -70,8 +71,6 @@ const findSearchRequestsForRealEstate = async realEstate => {
|
|||||||
query.priceMax = {
|
query.priceMax = {
|
||||||
[Op.gte]: price
|
[Op.gte]: price
|
||||||
};
|
};
|
||||||
} else {
|
|
||||||
checkForIncompleteWanted = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (area) {
|
if (area) {
|
||||||
|
|||||||
Reference in New Issue
Block a user