Code refactoring, fixed bug with price parsing:
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
const db = require('../../models/index');
|
||||
|
||||
// const db = require('../../models/index');
|
||||
// TODO Fetch only subscribed realestate requests
|
||||
const allRERequest = async () => {
|
||||
return await db.RealEstateRequest.findAll();
|
||||
}
|
||||
|
||||
const findPointInsideBoundingBox = async (latLng) => {
|
||||
return await db.sequelize.query("SELECT * FROM \"RealEstateRequests\" WHERE ST_Contains(\"RealEstateRequests\".bounding_box, ST_GEOMFROMTEXT(\'POINT (" + latLng[0] + " " + latLng[1]+ ")\'))");
|
||||
}
|
||||
|
||||
// const bulkInsert = async (reuslts) => {
|
||||
// db.MarketAlert.bulkCreate({
|
||||
|
||||
// })
|
||||
|
||||
// }
|
||||
module.exports = {
|
||||
allRERequest,
|
||||
findPointInsideBoundingBox
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user