Changed searchRequest helper

This commit is contained in:
Naida Vatric
2019-12-11 22:44:26 +01:00
parent dee7c6000a
commit e6e1688a49

View File

@@ -5,8 +5,11 @@ const Op = sequelize.Op;
const getSearchRequest = async searchRequestId => {
try {
console.log("test");
return await db.SearchRequest.findByPk(searchRequestId);
} catch (error) {
console.log("searchrequest.js",error);
return null;
}
};
@@ -22,7 +25,16 @@ const findSearchRequestsForRealEstate = async realEstate => {
adType,
realEstateType,
locationLat,
locationLong
locationLong,
//
accessRoadType,
balcony,
newBuilding,
elevator,
gardenSize,
numberOfRooms,
numberOfFloors,
floor
} = realEstate;
if (!locationLat || !locationLong) {