Changed accesRoadType logic

This commit is contained in:
Naida Vatric
2019-12-26 23:30:05 +01:00
parent 42ff1f762f
commit d5d3a1f306
2 changed files with 26 additions and 12 deletions

View File

@@ -137,7 +137,7 @@ const findSearchRequestsForRealEstate = async realEstate => {
}
}
//AccessRoadType is defined - should exits for each ad and estate type
//AccessRoadType is defined - should exists for each ad and estate type
if (accessRoadType != null) {
query.accessRoadType = {
[Op.or]: {
@@ -145,8 +145,11 @@ const findSearchRequestsForRealEstate = async realEstate => {
[Op.eq]: accessRoadType
}
};
} else if (realEstateTypeObject.hasAccesRoadType) {
checkForIncompleteWanted = true;
} else {
//Null values are returned for user request that wanted ANY acces road type
query.accessRoadType = {
[Op.eq]: "ANY"
};
}
if (realEstateTypeObject.hasBalconyProp) {