skip real estates without location in search

This commit is contained in:
Bilal Catic
2019-09-30 14:27:26 +02:00
parent 5e8e13a984
commit bbff526ea0

View File

@@ -21,6 +21,10 @@ const findSearchRequestsForRealEstate = async realEstate => {
locationLong
} = realEstate;
if (!locationLat || !locationLong) {
return [];
}
const stGeometry = sequelize.fn(
"ST_GEOMFROMTEXT",
`POINT (${locationLong} ${locationLat})`,