Merge branch 'master' into 'add-more-real-estate-filters'
# Conflicts: # app/views/standardFilters.ejs
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
.env
|
.env
|
||||||
.idea/
|
.idea/
|
||||||
|
.eslintrc
|
||||||
|
.vscode/
|
||||||
|
|||||||
@@ -104,6 +104,13 @@ const AD_CATEGORY = {
|
|||||||
id: "FLAT",
|
id: "FLAT",
|
||||||
title: "Stan",
|
title: "Stan",
|
||||||
hasGardenSize: false,
|
hasGardenSize: false,
|
||||||
|
hasAccesRoadType: true,
|
||||||
|
hasBalconyProp: true,
|
||||||
|
hasNewBuildingProp: true,
|
||||||
|
hasElevatorProp: true,
|
||||||
|
hasNumberOfRoom: true,
|
||||||
|
hasNumberOfFloors: false,
|
||||||
|
hasFloorProp: true,
|
||||||
priceSliderOptionsSale: PRICE_SLIDER_OPTIONS_SALE,
|
priceSliderOptionsSale: PRICE_SLIDER_OPTIONS_SALE,
|
||||||
priceSliderOptionsRent: PRICE_SLIDER_OPTIONS_RENT,
|
priceSliderOptionsRent: PRICE_SLIDER_OPTIONS_RENT,
|
||||||
sizeSliderOptions: HOME_SIZE_SLIDER_OPTIONS
|
sizeSliderOptions: HOME_SIZE_SLIDER_OPTIONS
|
||||||
@@ -112,6 +119,13 @@ const AD_CATEGORY = {
|
|||||||
id: "HOUSE",
|
id: "HOUSE",
|
||||||
title: "Kuća",
|
title: "Kuća",
|
||||||
hasGardenSize: true,
|
hasGardenSize: true,
|
||||||
|
hasAccesRoadType: true,
|
||||||
|
hasBalconyProp: true,
|
||||||
|
hasNewBuildingProp: true,
|
||||||
|
hasElevatorProp: false,
|
||||||
|
hasNumberOfRoom: true,
|
||||||
|
hasNumberOfFloors: true,
|
||||||
|
hasFloorProp: false,
|
||||||
priceSliderOptionsSale: PRICE_SLIDER_OPTIONS_SALE,
|
priceSliderOptionsSale: PRICE_SLIDER_OPTIONS_SALE,
|
||||||
priceSliderOptionsRent: PRICE_SLIDER_OPTIONS_RENT,
|
priceSliderOptionsRent: PRICE_SLIDER_OPTIONS_RENT,
|
||||||
sizeSliderOptions: HOME_SIZE_SLIDER_OPTIONS,
|
sizeSliderOptions: HOME_SIZE_SLIDER_OPTIONS,
|
||||||
@@ -121,6 +135,13 @@ const AD_CATEGORY = {
|
|||||||
id: "OFFICE",
|
id: "OFFICE",
|
||||||
title: "Kancelarija",
|
title: "Kancelarija",
|
||||||
hasGardenSize: false,
|
hasGardenSize: false,
|
||||||
|
hasAccesRoadType: true,
|
||||||
|
hasBalconyProp: false,
|
||||||
|
hasNewBuildingProp: true,
|
||||||
|
hasElevatorProp: true,
|
||||||
|
hasNumberOfRoom: true,
|
||||||
|
hasNumberOfFloors: false,
|
||||||
|
hasFloorProp: true,
|
||||||
priceSliderOptionsSale: PRICE_SLIDER_OPTIONS_SALE,
|
priceSliderOptionsSale: PRICE_SLIDER_OPTIONS_SALE,
|
||||||
priceSliderOptionsRent: PRICE_SLIDER_OPTIONS_RENT,
|
priceSliderOptionsRent: PRICE_SLIDER_OPTIONS_RENT,
|
||||||
sizeSliderOptions: HOME_SIZE_SLIDER_OPTIONS
|
sizeSliderOptions: HOME_SIZE_SLIDER_OPTIONS
|
||||||
@@ -129,6 +150,13 @@ const AD_CATEGORY = {
|
|||||||
id: "LAND",
|
id: "LAND",
|
||||||
title: "Zemljište",
|
title: "Zemljište",
|
||||||
hasGardenSize: false,
|
hasGardenSize: false,
|
||||||
|
hasAccesRoadType: true,
|
||||||
|
hasBalconyProp: false,
|
||||||
|
hasNewBuildingProp: false,
|
||||||
|
hasElevatorProp: false,
|
||||||
|
hasNumberOfRoom: false,
|
||||||
|
hasNumberOfFloors: false,
|
||||||
|
hasFloorProp: false,
|
||||||
priceSliderOptionsSale: PRICE_SLIDER_OPTIONS_SALE,
|
priceSliderOptionsSale: PRICE_SLIDER_OPTIONS_SALE,
|
||||||
priceSliderOptionsRent: PRICE_SLIDER_OPTIONS_RENT,
|
priceSliderOptionsRent: PRICE_SLIDER_OPTIONS_RENT,
|
||||||
sizeSliderOptions: LAND_SIZE_SLIDER_OPTIONS
|
sizeSliderOptions: LAND_SIZE_SLIDER_OPTIONS
|
||||||
@@ -137,6 +165,13 @@ const AD_CATEGORY = {
|
|||||||
id: "APARTMENT",
|
id: "APARTMENT",
|
||||||
title: "Apartman",
|
title: "Apartman",
|
||||||
hasGardenSize: false,
|
hasGardenSize: false,
|
||||||
|
hasAccesRoadType: true,
|
||||||
|
hasBalconyProp: true,
|
||||||
|
hasNewBuildingProp: true,
|
||||||
|
hasElevatorProp: true,
|
||||||
|
hasNumberOfRoom: true,
|
||||||
|
hasNumberOfFloors: false,
|
||||||
|
hasFloorProp: true,
|
||||||
priceSliderOptionsSale: PRICE_SLIDER_OPTIONS_SALE,
|
priceSliderOptionsSale: PRICE_SLIDER_OPTIONS_SALE,
|
||||||
priceSliderOptionsRent: PRICE_SLIDER_OPTIONS_RENT,
|
priceSliderOptionsRent: PRICE_SLIDER_OPTIONS_RENT,
|
||||||
sizeSliderOptions: HOME_SIZE_SLIDER_OPTIONS
|
sizeSliderOptions: HOME_SIZE_SLIDER_OPTIONS
|
||||||
@@ -145,6 +180,13 @@ const AD_CATEGORY = {
|
|||||||
id: "GARAGE",
|
id: "GARAGE",
|
||||||
title: "Garaža",
|
title: "Garaža",
|
||||||
hasGardenSize: false,
|
hasGardenSize: false,
|
||||||
|
hasAccesRoadType: true,
|
||||||
|
hasBalconyProp: false,
|
||||||
|
hasNewBuildingProp: false,
|
||||||
|
hasElevatorProp: false,
|
||||||
|
hasNumberOfRoom: false,
|
||||||
|
hasNumberOfFloors: false,
|
||||||
|
hasFloorProp: false,
|
||||||
priceSliderOptionsSale: GARAGE_PRICE_SLIDER_OPTIONS_SALE,
|
priceSliderOptionsSale: GARAGE_PRICE_SLIDER_OPTIONS_SALE,
|
||||||
priceSliderOptionsRent: GARAGE_PRICE_SLIDER_OPTIONS_RENT,
|
priceSliderOptionsRent: GARAGE_PRICE_SLIDER_OPTIONS_RENT,
|
||||||
sizeSliderOptions: GARAGE_SIZE_SLIDER_OPTIONS
|
sizeSliderOptions: GARAGE_SIZE_SLIDER_OPTIONS
|
||||||
@@ -153,6 +195,13 @@ const AD_CATEGORY = {
|
|||||||
id: "COTTAGE",
|
id: "COTTAGE",
|
||||||
title: "Vikendica",
|
title: "Vikendica",
|
||||||
hasGardenSize: true,
|
hasGardenSize: true,
|
||||||
|
hasAccesRoadType: true,
|
||||||
|
hasBalconyProp: true,
|
||||||
|
hasNewBuildingProp: true,
|
||||||
|
hasElevatorProp: false,
|
||||||
|
hasNumberOfRoom: true,
|
||||||
|
hasNumberOfFloors: true,
|
||||||
|
hasFloorProp: false,
|
||||||
priceSliderOptionsSale: PRICE_SLIDER_OPTIONS_SALE,
|
priceSliderOptionsSale: PRICE_SLIDER_OPTIONS_SALE,
|
||||||
priceSliderOptionsRent: PRICE_SLIDER_OPTIONS_RENT,
|
priceSliderOptionsRent: PRICE_SLIDER_OPTIONS_RENT,
|
||||||
sizeSliderOptions: HOME_SIZE_SLIDER_OPTIONS,
|
sizeSliderOptions: HOME_SIZE_SLIDER_OPTIONS,
|
||||||
|
|||||||
@@ -4,9 +4,37 @@ const getLocation = async (req, res) => {
|
|||||||
const title = "Odaberite lokaciju";
|
const title = "Odaberite lokaciju";
|
||||||
const nextStep = req.query.nextStep || "/";
|
const nextStep = req.query.nextStep || "/";
|
||||||
|
|
||||||
|
//Check if location data already exists (active request)
|
||||||
|
//If it does then get location is called through edit field query
|
||||||
|
//and map should show already selected location not initial map
|
||||||
|
let selectedLatLngBounds = {};
|
||||||
|
let boundsSelected = false;
|
||||||
|
|
||||||
|
const searchRequest = await currentSearchRequest(req);
|
||||||
|
|
||||||
|
if (!searchRequest || !searchRequest.dataValues) {
|
||||||
|
res.render("notFound", { title: " " });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const selectedArea = searchRequest.areaToSearch;
|
||||||
|
const sw = selectedArea.coordinates[0][3];
|
||||||
|
const ne = selectedArea.coordinates[0][1];
|
||||||
|
|
||||||
|
if (sw[0] && ne[0]) {
|
||||||
|
selectedLatLngBounds = {
|
||||||
|
swLat: sw[1],
|
||||||
|
swLng: sw[0],
|
||||||
|
neLat: ne[1],
|
||||||
|
neLng: ne[0]
|
||||||
|
};
|
||||||
|
boundsSelected = true;
|
||||||
|
}
|
||||||
|
|
||||||
res.render("location", {
|
res.render("location", {
|
||||||
nextStep,
|
nextStep,
|
||||||
title
|
title,
|
||||||
|
boundsSelected,
|
||||||
|
selectedLatLngBounds
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -232,7 +232,6 @@ const postFilters = async (req, res) => {
|
|||||||
searchRequest.gardenSizeMin = gardenSizeMin;
|
searchRequest.gardenSizeMin = gardenSizeMin;
|
||||||
searchRequest.gardenSizeMax = gardenSizeMax;
|
searchRequest.gardenSizeMax = gardenSizeMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
await searchRequest.save();
|
await searchRequest.save();
|
||||||
|
|
||||||
res.redirect(nextStepUrl);
|
res.redirect(nextStepUrl);
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ class RentalCrawler {
|
|||||||
|
|
||||||
let numberOfRooms =
|
let numberOfRooms =
|
||||||
parseInt(extractedData["re_realEstates_roomsNO"]) +
|
parseInt(extractedData["re_realEstates_roomsNO"]) +
|
||||||
parseInt(extractedData["re_realEstates_bedroomNO"]) || null,
|
parseInt(extractedData["re_realEstates_bedNO"]) || null,
|
||||||
numberOfFloors =
|
numberOfFloors =
|
||||||
parseInt(extractedData["re_realEstates_floorsNO"]) ||
|
parseInt(extractedData["re_realEstates_floorsNO"]) ||
|
||||||
this.getNumberOfFloorsFromFloorId(extractedData["re_floorNO_id"]),
|
this.getNumberOfFloorsFromFloorId(extractedData["re_floorNO_id"]),
|
||||||
@@ -352,7 +352,9 @@ class RentalCrawler {
|
|||||||
realEstatePropertiesFromInfrastructure.phoneConnection,
|
realEstatePropertiesFromInfrastructure.phoneConnection,
|
||||||
cableTV = realEstatePropertiesFromInfrastructure.cableTV,
|
cableTV = realEstatePropertiesFromInfrastructure.cableTV,
|
||||||
internet = realEstatePropertiesFromInfrastructure.internet,
|
internet = realEstatePropertiesFromInfrastructure.internet,
|
||||||
basementAttic = realEstatePropertiesFromSpaces.basementAttic,
|
basementAttic =
|
||||||
|
realEstatePropertiesFromSpaces.basementAttic ||
|
||||||
|
this.checkBasemAtticFromFloors(extractedData["re_floorNO_id"]),
|
||||||
storeRoom = realEstatePropertiesFromSpaces.storeRoom,
|
storeRoom = realEstatePropertiesFromSpaces.storeRoom,
|
||||||
videoSurveillance =
|
videoSurveillance =
|
||||||
realEstatePropertiesFromDescriptions.videoSurveillance ||
|
realEstatePropertiesFromDescriptions.videoSurveillance ||
|
||||||
@@ -397,9 +399,7 @@ class RentalCrawler {
|
|||||||
);
|
);
|
||||||
if (!publishedDateMoment.isValid()) {
|
if (!publishedDateMoment.isValid()) {
|
||||||
throw {
|
throw {
|
||||||
message: `Invalid published date : ${
|
message: `Invalid published date : ${extractedData["re_realEstates_inserted"]}`
|
||||||
extractedData["re_realEstates_inserted"]
|
|
||||||
}`
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,9 +410,7 @@ class RentalCrawler {
|
|||||||
);
|
);
|
||||||
if (!renewedDateMoment.isValid()) {
|
if (!renewedDateMoment.isValid()) {
|
||||||
throw {
|
throw {
|
||||||
message: `Invalid renewed date : ${
|
message: `Invalid renewed date : ${extractedData["re_realEstates_edited"]}`
|
||||||
extractedData["re_realEstates_edited"]
|
|
||||||
}`
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -782,8 +780,42 @@ class RentalCrawler {
|
|||||||
if (floorIds.length === 0) {
|
if (floorIds.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
let noOfFloors = floorIds.length;
|
||||||
|
// Floors of 'suteren', 'podrum', 'tavan' and 'potkrovlje' are not counted
|
||||||
|
floorIds.forEach(id => {
|
||||||
|
if (
|
||||||
|
parseInt(id) === 1 ||
|
||||||
|
parseInt(id) === 2 ||
|
||||||
|
parseInt(id) === 12 ||
|
||||||
|
parseInt(id) === 14
|
||||||
|
) {
|
||||||
|
noOfFloors--;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return noOfFloors;
|
||||||
|
}
|
||||||
|
|
||||||
return floorIds.length;
|
checkBasemAtticFromFloors(floorsIdText) {
|
||||||
|
// floorIdText can be array of numbers, separated by comma or number
|
||||||
|
const floorIds = floorsIdText.split(",");
|
||||||
|
|
||||||
|
let check = false;
|
||||||
|
|
||||||
|
if (floorIds.length === 0) {
|
||||||
|
check = false;
|
||||||
|
}
|
||||||
|
//If floors 'suteren', 'podrum', 'tavan' and 'potkrovlje' exists then tag for basement-attic is true
|
||||||
|
floorIds.forEach(id => {
|
||||||
|
if (
|
||||||
|
parseInt(id) === 1 ||
|
||||||
|
parseInt(id) === 2 ||
|
||||||
|
parseInt(id) === 12 ||
|
||||||
|
parseInt(id) === 14
|
||||||
|
) {
|
||||||
|
check = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return check;
|
||||||
}
|
}
|
||||||
|
|
||||||
async sleep(ms) {
|
async sleep(ms) {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
const db = require("../../models/index");
|
const db = require("../../models/index");
|
||||||
const sequelize = require("sequelize");
|
const sequelize = require("sequelize");
|
||||||
const Op = sequelize.Op;
|
const Op = sequelize.Op;
|
||||||
|
|
||||||
const bulkUpsertRealEstates = async realEstateData => {
|
const bulkUpsertRealEstates = async realEstateData => {
|
||||||
try {
|
try {
|
||||||
const fieldsToUpdateIfDuplicate = [
|
const fieldsToUpdateIfDuplicate = [
|
||||||
@@ -87,7 +86,20 @@ const findRealEstatesForSearchRequest = async (searchRequest, maxResults) => {
|
|||||||
sizeMax,
|
sizeMax,
|
||||||
adType,
|
adType,
|
||||||
realEstateType,
|
realEstateType,
|
||||||
areaToSearch
|
areaToSearch,
|
||||||
|
gardenSizeMin,
|
||||||
|
gardenSizeMax,
|
||||||
|
numberOfRoomsMin,
|
||||||
|
numberOfRoomsMax,
|
||||||
|
numberOfFloorsMin,
|
||||||
|
numberOfFloorsMax,
|
||||||
|
floorMin,
|
||||||
|
floorMax,
|
||||||
|
includeIncompleteAds,
|
||||||
|
balcony,
|
||||||
|
elevator,
|
||||||
|
newBuilding,
|
||||||
|
accessRoadType
|
||||||
} = searchRequest;
|
} = searchRequest;
|
||||||
|
|
||||||
const longitudeColumn = sequelize.col("locationLong");
|
const longitudeColumn = sequelize.col("locationLong");
|
||||||
@@ -116,12 +128,20 @@ const findRealEstatesForSearchRequest = async (searchRequest, maxResults) => {
|
|||||||
|
|
||||||
const geoSearchQueryPart = sequelize.where(contains, true);
|
const geoSearchQueryPart = sequelize.where(contains, true);
|
||||||
|
|
||||||
|
//General queries contain only attributes that are defined for every searchreq
|
||||||
|
|
||||||
|
//Query for case of complete ads
|
||||||
const query = {
|
const query = {
|
||||||
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,
|
||||||
@@ -130,10 +150,148 @@ const findRealEstatesForSearchRequest = async (searchRequest, maxResults) => {
|
|||||||
[Op.and]: geoSearchQueryPart
|
[Op.and]: geoSearchQueryPart
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//Query for case of incomplete ads
|
||||||
|
const queryIncludeIncomplete = {
|
||||||
|
adType,
|
||||||
|
realEstateType,
|
||||||
|
price: {
|
||||||
|
[Op.or]: {
|
||||||
|
[Op.and]: {
|
||||||
|
[Op.lte]: priceMax,
|
||||||
|
[Op.gte]: priceMin
|
||||||
|
},
|
||||||
|
[Op.is]: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
area: {
|
||||||
|
[Op.or]: {
|
||||||
|
[Op.and]: {
|
||||||
|
[Op.lte]: sizeMax,
|
||||||
|
[Op.gte]: sizeMin
|
||||||
|
},
|
||||||
|
[Op.is]: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[Op.and]: geoSearchQueryPart
|
||||||
|
};
|
||||||
|
|
||||||
|
//Every other attribute is checked separately and included in query only if it is defined
|
||||||
|
if (gardenSizeMax && gardenSizeMin) {
|
||||||
|
query.gardenSize = {
|
||||||
|
[Op.lte]: gardenSizeMax,
|
||||||
|
[Op.gte]: gardenSizeMin
|
||||||
|
};
|
||||||
|
queryIncludeIncomplete.gardenSize = {
|
||||||
|
[Op.or]: {
|
||||||
|
[Op.and]: {
|
||||||
|
[Op.lte]: gardenSizeMax,
|
||||||
|
[Op.gte]: gardenSizeMin
|
||||||
|
},
|
||||||
|
[Op.is]: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (numberOfRoomsMin && numberOfRoomsMax) {
|
||||||
|
query.numberOfRooms = {
|
||||||
|
[Op.lte]: numberOfRoomsMax,
|
||||||
|
[Op.gte]: numberOfRoomsMin
|
||||||
|
};
|
||||||
|
queryIncludeIncomplete.numberOfRooms = {
|
||||||
|
[Op.or]: {
|
||||||
|
[Op.and]: {
|
||||||
|
[Op.lte]: numberOfRoomsMax,
|
||||||
|
[Op.gte]: numberOfRoomsMin
|
||||||
|
},
|
||||||
|
[Op.is]: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (numberOfFloorsMin && numberOfFloorsMax) {
|
||||||
|
query.numberOfFloors = {
|
||||||
|
[Op.lte]: numberOfFloorsMax,
|
||||||
|
[Op.gte]: numberOfFloorsMin
|
||||||
|
};
|
||||||
|
queryIncludeIncomplete.numberOfFloors = {
|
||||||
|
[Op.or]: {
|
||||||
|
[Op.and]: {
|
||||||
|
[Op.lte]: numberOfFloorsMax,
|
||||||
|
[Op.gte]: numberOfFloorsMin
|
||||||
|
},
|
||||||
|
[Op.is]: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (floorMin && floorMax) {
|
||||||
|
query.floor = {
|
||||||
|
[Op.lte]: floorMax,
|
||||||
|
[Op.gte]: floorMin
|
||||||
|
};
|
||||||
|
queryIncludeIncomplete.floor = {
|
||||||
|
[Op.or]: {
|
||||||
|
[Op.and]: {
|
||||||
|
[Op.lte]: floorMax,
|
||||||
|
[Op.gte]: floorMin
|
||||||
|
},
|
||||||
|
[Op.is]: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (balcony) {
|
||||||
|
query.balcony = {
|
||||||
|
[Op.eq]: balcony
|
||||||
|
};
|
||||||
|
queryIncludeIncomplete.balcony = {
|
||||||
|
[Op.or]: {
|
||||||
|
[Op.eq]: balcony,
|
||||||
|
[Op.is]: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newBuilding) {
|
||||||
|
query.newBuilding = {
|
||||||
|
[Op.eq]: newBuilding
|
||||||
|
};
|
||||||
|
queryIncludeIncomplete.newBuilding = {
|
||||||
|
[Op.or]: {
|
||||||
|
[Op.eq]: newBuilding,
|
||||||
|
[Op.is]: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (elevator) {
|
||||||
|
query.elevator = {
|
||||||
|
[Op.eq]: elevator
|
||||||
|
};
|
||||||
|
queryIncludeIncomplete.elevator = {
|
||||||
|
[Op.or]: {
|
||||||
|
[Op.eq]: elevator,
|
||||||
|
[Op.is]: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (accessRoadType !== "ANY") {
|
||||||
|
query.accessRoadType = {
|
||||||
|
[Op.eq]: accessRoadType
|
||||||
|
};
|
||||||
|
queryIncludeIncomplete.accessRoadType = {
|
||||||
|
[Op.or]: {
|
||||||
|
[Op.eq]: accessRoadType,
|
||||||
|
[Op.is]: null
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const order = [["updatedAt", "desc"]];
|
const order = [["updatedAt", "desc"]];
|
||||||
|
|
||||||
return await db.RealEstate.findAll({
|
return db.RealEstate.findAll({
|
||||||
where: query,
|
where: includeIncompleteAds ? queryIncludeIncomplete : query,
|
||||||
limit: maxResults,
|
limit: maxResults,
|
||||||
order
|
order
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,11 +2,13 @@
|
|||||||
const db = require("../../models/index");
|
const db = require("../../models/index");
|
||||||
const sequelize = require("sequelize");
|
const sequelize = require("sequelize");
|
||||||
const Op = sequelize.Op;
|
const Op = sequelize.Op;
|
||||||
|
const { AD_CATEGORY } = require("../../common/enums");
|
||||||
|
|
||||||
const getSearchRequest = async searchRequestId => {
|
const getSearchRequest = async searchRequestId => {
|
||||||
try {
|
try {
|
||||||
return await db.SearchRequest.findByPk(searchRequestId);
|
return await db.SearchRequest.findByPk(searchRequestId);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log("searchrequest.js", error);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -22,7 +24,15 @@ const findSearchRequestsForRealEstate = async realEstate => {
|
|||||||
adType,
|
adType,
|
||||||
realEstateType,
|
realEstateType,
|
||||||
locationLat,
|
locationLat,
|
||||||
locationLong
|
locationLong,
|
||||||
|
accessRoadType,
|
||||||
|
balcony,
|
||||||
|
newBuilding,
|
||||||
|
elevator,
|
||||||
|
gardenSize,
|
||||||
|
numberOfRooms,
|
||||||
|
numberOfFloors,
|
||||||
|
floor
|
||||||
} = realEstate;
|
} = realEstate;
|
||||||
|
|
||||||
if (!locationLat || !locationLong) {
|
if (!locationLat || !locationLong) {
|
||||||
@@ -39,12 +49,20 @@ const findSearchRequestsForRealEstate = async realEstate => {
|
|||||||
|
|
||||||
const geoSearchQueryPart = sequelize.where(contains, true);
|
const geoSearchQueryPart = sequelize.where(contains, true);
|
||||||
|
|
||||||
|
//General query contains only attributes that are defined for every RealEstate - not null
|
||||||
const query = {
|
const query = {
|
||||||
adType,
|
adType,
|
||||||
realEstateType,
|
realEstateType,
|
||||||
subscribed: true,
|
subscribed: true,
|
||||||
[Op.and]: geoSearchQueryPart
|
[Op.and]: geoSearchQueryPart
|
||||||
};
|
};
|
||||||
|
//Needed for defining which attribute should exist or not
|
||||||
|
const realEstateTypeObject = AD_CATEGORY[realEstateType];
|
||||||
|
//Needed to decide on including incomplete RealEstates data
|
||||||
|
let checkForIncompleteWanted = false;
|
||||||
|
|
||||||
|
//Attributes are checked separately and included in query only if defined
|
||||||
|
//Price and area should be defined for every property
|
||||||
|
|
||||||
if (price) {
|
if (price) {
|
||||||
query.priceMin = {
|
query.priceMin = {
|
||||||
@@ -62,8 +80,96 @@ const findSearchRequestsForRealEstate = async realEstate => {
|
|||||||
query.sizeMax = {
|
query.sizeMax = {
|
||||||
[Op.gte]: area
|
[Op.gte]: area
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
checkForIncompleteWanted = true;
|
||||||
|
}
|
||||||
|
//Other attributes can be defined or not depending on RealEstate type
|
||||||
|
if (gardenSize) {
|
||||||
|
query.gardenSizeMin = {
|
||||||
|
[Op.lte]: gardenSize
|
||||||
|
};
|
||||||
|
query.gardenSizeMax = {
|
||||||
|
[Op.gte]: gardenSize
|
||||||
|
};
|
||||||
|
} else if (realEstateTypeObject.hasGardenSize) {
|
||||||
|
checkForIncompleteWanted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (numberOfRooms) {
|
||||||
|
query.numberOfRoomsMin = {
|
||||||
|
[Op.lte]: numberOfRooms
|
||||||
|
};
|
||||||
|
query.numberOfRoomsMax = {
|
||||||
|
[Op.gte]: numberOfRooms
|
||||||
|
};
|
||||||
|
} else if (realEstateTypeObject.hasNumberOfRoom) {
|
||||||
|
checkForIncompleteWanted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (numberOfFloors) {
|
||||||
|
query.numberOfFloorsMin = {
|
||||||
|
[Op.lte]: numberOfFloors
|
||||||
|
};
|
||||||
|
query.numberOfFloorsMax = {
|
||||||
|
[Op.gte]: numberOfFloors
|
||||||
|
};
|
||||||
|
} else if (realEstateTypeObject.hasNumberOfFloors) {
|
||||||
|
checkForIncompleteWanted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (floor) {
|
||||||
|
query.floorMin = {
|
||||||
|
[Op.lte]: floor
|
||||||
|
};
|
||||||
|
query.floorMax = {
|
||||||
|
[Op.gte]: floor
|
||||||
|
};
|
||||||
|
} else if (realEstateTypeObject.hasFloorProp) {
|
||||||
|
checkForIncompleteWanted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (accessRoadType) {
|
||||||
|
query.accessRoadType = {
|
||||||
|
[Op.or]: {
|
||||||
|
[Op.eq]: "ANY",
|
||||||
|
[Op.eq]: accessRoadType
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} else if (realEstateTypeObject.hasAccesRoadType) {
|
||||||
|
checkForIncompleteWanted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (balcony) {
|
||||||
|
query.balcony = {
|
||||||
|
[Op.eq]: balcony
|
||||||
|
};
|
||||||
|
} else if (realEstateTypeObject.hasBalconyProp) {
|
||||||
|
checkForIncompleteWanted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newBuilding) {
|
||||||
|
query.newBuilding = {
|
||||||
|
[Op.eq]: newBuilding
|
||||||
|
};
|
||||||
|
} else if (realEstateTypeObject.hasNewBuildingProp) {
|
||||||
|
checkForIncompleteWanted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (elevator) {
|
||||||
|
query.elevator = {
|
||||||
|
[Op.eq]: elevator
|
||||||
|
};
|
||||||
|
} else if (realEstateTypeObject.hasElevatorProp) {
|
||||||
|
checkForIncompleteWanted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//If one of the attributes that exists for property type is null
|
||||||
|
//we include in query to check if incomplete real estates are accepted
|
||||||
|
if (checkForIncompleteWanted) {
|
||||||
|
query.includeIncompleteAds = {
|
||||||
|
[Op.eq]: true
|
||||||
|
};
|
||||||
|
}
|
||||||
return await db.SearchRequest.findAll({ where: query });
|
return await db.SearchRequest.findAll({ where: query });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
<div class="row center-align">
|
<div class="row center-align">
|
||||||
<h3>
|
<h3>
|
||||||
Područje na mapi će biti uključeno u pretragu. Namjestite mapu na ulice
|
Područje na mapi će biti uključeno u pretragu. Namjestite mapu na ulice koje
|
||||||
koje želite da budu vidljive.
|
želite da budu vidljive.
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row center-align">
|
<div class="row center-align">
|
||||||
<div class="col s12 m12 l12 xl12">
|
<div class="col s12 m12 l12 xl12">
|
||||||
<input id="autocompleteInput" placeholder="Unesite grad, naselje ili ulicu..." type="text" />
|
<input
|
||||||
|
id="autocompleteInput"
|
||||||
|
placeholder="Unesite grad, naselje ili ulicu..."
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -17,12 +21,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<br />
|
||||||
|
|
||||||
<form method="POST" id="form-map-output">
|
<form method="POST" id="form-map-output">
|
||||||
<div class="row center-align">
|
<div class="row center-align">
|
||||||
<div class="col s6 push-s3">
|
<div class="col s6 push-s3">
|
||||||
<a id="submit" href="#" class="welcome-center-button waves-effect waves-light btn">Dalje</a>
|
<a
|
||||||
|
id="submit"
|
||||||
|
href="#"
|
||||||
|
class="welcome-center-button waves-effect waves-light btn"
|
||||||
|
>Dalje</a
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="north" id="north" />
|
<input type="hidden" name="north" id="north" />
|
||||||
@@ -41,15 +50,15 @@
|
|||||||
|
|
||||||
function locateMe() {
|
function locateMe() {
|
||||||
if (navigator.geolocation) {
|
if (navigator.geolocation) {
|
||||||
|
function onLocationSuccess(position) {
|
||||||
function onLocationSuccess (position) {
|
const coordinates =
|
||||||
const coordinates = position && position.coords ? position.coords : null;
|
position && position.coords ? position.coords : null;
|
||||||
if (coordinates){
|
if (coordinates) {
|
||||||
const longitude = coordinates.longitude || null;
|
const longitude = coordinates.longitude || null;
|
||||||
const latitude = coordinates.latitude || null;
|
const latitude = coordinates.latitude || null;
|
||||||
|
|
||||||
if (longitude && latitude && map){
|
if (longitude && latitude && map) {
|
||||||
map.setCenter({lat: latitude, lng: longitude});
|
map.setCenter({ lat: latitude, lng: longitude });
|
||||||
map.setZoom(16);
|
map.setZoom(16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,20 +70,20 @@
|
|||||||
|
|
||||||
function initMap() {
|
function initMap() {
|
||||||
const BOSNIA_BOUNDS = {
|
const BOSNIA_BOUNDS = {
|
||||||
north: 45.70,
|
north: 45.7,
|
||||||
south: 41.69,
|
south: 41.69,
|
||||||
west: 15.55,
|
west: 15.55,
|
||||||
east: 20.77,
|
east: 20.77
|
||||||
};
|
};
|
||||||
const SARAJEVO_COORDINATES = {
|
const SARAJEVO_COORDINATES = {
|
||||||
lat: 43.85,
|
lat: 43.85,
|
||||||
lng: 18.41,
|
lng: 18.41
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapElement = document.getElementById('map');
|
const mapElement = document.getElementById("map");
|
||||||
const restrictMapPanningToBosniaOnly = {
|
const restrictMapPanningToBosniaOnly = {
|
||||||
latLngBounds: BOSNIA_BOUNDS,
|
latLngBounds: BOSNIA_BOUNDS,
|
||||||
strictBounds: true,
|
strictBounds: true
|
||||||
};
|
};
|
||||||
const initialMapParams = {
|
const initialMapParams = {
|
||||||
center: SARAJEVO_COORDINATES,
|
center: SARAJEVO_COORDINATES,
|
||||||
@@ -87,38 +96,50 @@
|
|||||||
};
|
};
|
||||||
map = new google.maps.Map(mapElement, initialMapParams);
|
map = new google.maps.Map(mapElement, initialMapParams);
|
||||||
|
|
||||||
const inputElement = document.getElementById('autocompleteInput');
|
const inputElement = document.getElementById("autocompleteInput");
|
||||||
const restrictAutocompleteResultsToBosniaOnly = {'country': 'ba'};
|
const restrictAutocompleteResultsToBosniaOnly = { country: "ba" };
|
||||||
const initialAutocompleteParams = {
|
const initialAutocompleteParams = {
|
||||||
types: ['geocode'],
|
types: ["geocode"],
|
||||||
componentRestrictions: restrictAutocompleteResultsToBosniaOnly,
|
componentRestrictions: restrictAutocompleteResultsToBosniaOnly,
|
||||||
fields: ['geometry', 'types', 'address_components']
|
fields: ["geometry", "types", "address_components"]
|
||||||
};
|
};
|
||||||
|
|
||||||
autocomplete = new google.maps.places.Autocomplete(inputElement, initialAutocompleteParams);
|
autocomplete = new google.maps.places.Autocomplete(
|
||||||
autocomplete.bindTo('bounds', map);
|
inputElement,
|
||||||
autocomplete.addListener('place_changed', onPlaceChanged);
|
initialAutocompleteParams
|
||||||
|
);
|
||||||
|
autocomplete.bindTo("bounds", map);
|
||||||
|
autocomplete.addListener("place_changed", onPlaceChanged);
|
||||||
pacSelectFirst(inputElement);
|
pacSelectFirst(inputElement);
|
||||||
addLocateMeButton(map);
|
addLocateMeButton(map);
|
||||||
|
|
||||||
|
//After map initialization we check if area is already selected
|
||||||
|
//If yes we bound map to show already selected area
|
||||||
|
const boundsSelected = <%- boundsSelected %>;
|
||||||
|
const selectedLatLngBounds = <%- JSON.stringify(selectedLatLngBounds) %>;
|
||||||
|
|
||||||
|
if (boundsSelected) {
|
||||||
|
boundMapToSelected(map, selectedLatLngBounds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addLocateMeButton(map) {
|
function addLocateMeButton(map) {
|
||||||
var parent = document.createElement('div');
|
var parent = document.createElement("div");
|
||||||
parent.className = "locate-me-container";
|
parent.className = "locate-me-container";
|
||||||
|
|
||||||
var a = document.createElement('a');
|
var a = document.createElement("a");
|
||||||
a.id = "locateMe";
|
a.id = "locateMe";
|
||||||
a.className = "btn-floating";
|
a.className = "btn-floating";
|
||||||
|
|
||||||
var i = document.createElement('i');
|
var i = document.createElement("i");
|
||||||
i.innerText = "gps_fixed";
|
i.innerText = "gps_fixed";
|
||||||
i.className = "material-icons right";
|
i.className = "material-icons right";
|
||||||
|
|
||||||
a.appendChild(i)
|
a.appendChild(i);
|
||||||
a.addEventListener("click", locateMe);
|
a.addEventListener("click", locateMe);
|
||||||
parent.appendChild(a)
|
parent.appendChild(a);
|
||||||
|
|
||||||
map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(parent)
|
map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPlaceChanged() {
|
function onPlaceChanged() {
|
||||||
@@ -133,33 +154,49 @@
|
|||||||
function pacSelectFirst(input) {
|
function pacSelectFirst(input) {
|
||||||
// store the original event binding function
|
// store the original event binding function
|
||||||
const _addEventListener = input.addEventListener
|
const _addEventListener = input.addEventListener
|
||||||
? input.addEventListener
|
? input.addEventListener
|
||||||
: input.attachEvent
|
: input.attachEvent;
|
||||||
|
|
||||||
function addEventListenerWrapper (type, listener) {
|
function addEventListenerWrapper(type, listener) {
|
||||||
// Simulate a 'down arrow' keypress on hitting 'return' when no pac suggestion is selected,
|
// Simulate a 'down arrow' keypress on hitting 'return' when no pac suggestion is selected,
|
||||||
// and then trigger the original listener.
|
// and then trigger the original listener.
|
||||||
if (type == 'keydown') {
|
if (type == "keydown") {
|
||||||
const originalListener = listener
|
const originalListener = listener;
|
||||||
listener = function (event) {
|
listener = function(event) {
|
||||||
const suggestionSelected = $('.pac-item-selected').length > 0
|
const suggestionSelected = $(".pac-item-selected").length > 0;
|
||||||
if (event.key == 'Enter' && !suggestionSelected) {
|
if (event.key == "Enter" && !suggestionSelected) {
|
||||||
const simulatedDownArrow = $.Event('keydown', {
|
const simulatedDownArrow = $.Event("keydown", {
|
||||||
keyCode: 40,
|
keyCode: 40,
|
||||||
which: 40
|
which: 40
|
||||||
})
|
});
|
||||||
originalListener.apply(input, [simulatedDownArrow])
|
originalListener.apply(input, [simulatedDownArrow]);
|
||||||
}
|
}
|
||||||
|
|
||||||
originalListener.apply(input, [event])
|
originalListener.apply(input, [event]);
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
_addEventListener.apply(input, [type, listener])
|
_addEventListener.apply(input, [type, listener]);
|
||||||
}
|
}
|
||||||
|
|
||||||
input.addEventListener = addEventListenerWrapper
|
input.addEventListener = addEventListenerWrapper;
|
||||||
input.attachEvent = addEventListenerWrapper
|
input.attachEvent = addEventListenerWrapper;
|
||||||
|
}
|
||||||
|
function boundMapToSelected(map, selectedLatLngBounds) {
|
||||||
|
|
||||||
|
const swBound = new google.maps.LatLng(
|
||||||
|
selectedLatLngBounds.swLat,
|
||||||
|
selectedLatLngBounds.swLng
|
||||||
|
);
|
||||||
|
const neBound = new google.maps.LatLng(
|
||||||
|
selectedLatLngBounds.neLat,
|
||||||
|
selectedLatLngBounds.neLng
|
||||||
|
);
|
||||||
|
let bounds = new google.maps.LatLngBounds();
|
||||||
|
bounds.extend(swBound);
|
||||||
|
bounds.extend(neBound);
|
||||||
|
|
||||||
|
map.fitBounds(bounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
@@ -171,11 +208,16 @@
|
|||||||
$("#east").val(mapBounds.getNorthEast().lng());
|
$("#east").val(mapBounds.getNorthEast().lng());
|
||||||
$("#west").val(mapBounds.getSouthWest().lng());
|
$("#west").val(mapBounds.getSouthWest().lng());
|
||||||
|
|
||||||
$("#locationInput").val(document.getElementById('autocompleteInput').value);
|
$("#locationInput").val(
|
||||||
|
document.getElementById("autocompleteInput").value
|
||||||
|
);
|
||||||
|
|
||||||
$("#form-map-output").submit();
|
$("#form-map-output").submit();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script src="https://maps.googleapis.com/maps/api/js?key=<%= process.env.API_MAP_KEY %>&language=bs&libraries=places&callback=initMap" async
|
<script
|
||||||
defer></script>
|
src="https://maps.googleapis.com/maps/api/js?key=<%= process.env.API_MAP_KEY %>&language=bs&libraries=places&callback=initMap"
|
||||||
|
async
|
||||||
|
defer
|
||||||
|
></script>
|
||||||
|
|||||||
@@ -1,66 +1,73 @@
|
|||||||
<br>
|
<br />
|
||||||
|
|
||||||
<div class="row center-align">
|
<div class="row center-align">
|
||||||
<h5>Cijena</h5>
|
<h5>Cijena (KM)</h5>
|
||||||
<br><br>
|
<br /><br />
|
||||||
<div class="col s12">
|
<div class="col s12">
|
||||||
<div class="center-align no-ui-slider" id="priceFilter"></div>
|
<div class="center-align no-ui-slider" id="priceFilter"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<br />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col s5 m3 l3 push-m1 push-l2">
|
<div class="col s5 m3 l3 push-m1 push-l2">
|
||||||
<input class="sliderInputBox" type="number" id="priceMin" name="priceMin">
|
<input class="sliderInputBox" type="number" id="priceMin" name="priceMin" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col s5 m3 l3 push-s1 push-m4 push-l4">
|
<div class="col s5 m3 l3 push-s1 push-m4 push-l4">
|
||||||
<input class="sliderInputBox" type="number" id="priceMax" name="priceMax">
|
<input class="sliderInputBox" type="number" id="priceMax" name="priceMax" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<br />
|
||||||
|
|
||||||
<div class="row center-align">
|
<div class="row center-align">
|
||||||
<h5>Površina</h5>
|
<h5>Površina (m<sup>2</sup>)</h5>
|
||||||
<br><br>
|
<br /><br />
|
||||||
<div class="col s12">
|
<div class="col s12">
|
||||||
<div class="center-align no-ui-slider" id="sizeFilter"></div>
|
<div class="center-align no-ui-slider" id="sizeFilter"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<br />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col s5 m3 l3 push-m1 push-l2">
|
<div class="col s5 m3 l3 push-m1 push-l2">
|
||||||
<input class="sliderInputBox" type="number" id="sizeMin" name="sizeMin">
|
<input class="sliderInputBox" type="number" id="sizeMin" name="sizeMin" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col s5 m3 l3 push-s1 push-m4 push-l4">
|
<div class="col s5 m3 l3 push-s1 push-m4 push-l4">
|
||||||
<input class="sliderInputBox" type="number" id="sizeMax" name="sizeMax">
|
<input class="sliderInputBox" type="number" id="sizeMax" name="sizeMax" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<br />
|
||||||
|
|
||||||
<% if(hasGardenSize) { %>
|
<% if(hasGardenSize) { %>
|
||||||
<div class="row center-align">
|
<div class="row center-align">
|
||||||
<h5>Površina okućnice</h5>
|
<h5>Površina okućnice (m<sup>2</sup>)</h5>
|
||||||
<br><br>
|
<br /><br />
|
||||||
<div class="col s12">
|
<div class="col s12">
|
||||||
<div class="center-align no-ui-slider" id="gardenSizeFilter"></div>
|
<div class="center-align no-ui-slider" id="gardenSizeFilter"></div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<br>
|
<br />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col s5 m3 l3 push-m1 push-l2">
|
<div class="col s5 m3 l3 push-m1 push-l2">
|
||||||
<input class="sliderInputBox" type="number" id="gardenSizeMin" name="gardenSizeMin">
|
<input
|
||||||
|
class="sliderInputBox"
|
||||||
</div>
|
type="number"
|
||||||
<div class="col s5 m3 l3 push-s1 push-m4 push-l4">
|
id="gardenSizeMin"
|
||||||
<input class="sliderInputBox" type="number" id="gardenSizeMax" name="gardenSizeMax">
|
name="gardenSizeMin"
|
||||||
</div>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col s5 m3 l3 push-s1 push-m4 push-l4">
|
||||||
|
<input
|
||||||
|
class="sliderInputBox"
|
||||||
|
type="number"
|
||||||
|
id="gardenSizeMax"
|
||||||
|
name="gardenSizeMax"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
26
package-lock.json
generated
26
package-lock.json
generated
@@ -1052,6 +1052,14 @@
|
|||||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
|
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
|
||||||
},
|
},
|
||||||
|
"eslint-plugin-prettier": {
|
||||||
|
"version": "3.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz",
|
||||||
|
"integrity": "sha512-GlolCC9y3XZfv3RQfwGew7NnuFDKsfI4lbvRK+PIIo23SFH+LemGs4cKwzAaRa+Mdb+lQO/STaIayno8T5sJJA==",
|
||||||
|
"requires": {
|
||||||
|
"prettier-linter-helpers": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"etag": {
|
"etag": {
|
||||||
"version": "1.8.1",
|
"version": "1.8.1",
|
||||||
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
||||||
@@ -1271,6 +1279,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
|
||||||
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk="
|
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk="
|
||||||
},
|
},
|
||||||
|
"fast-diff": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w=="
|
||||||
|
},
|
||||||
"fast-json-stable-stringify": {
|
"fast-json-stable-stringify": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
|
||||||
@@ -3179,6 +3192,19 @@
|
|||||||
"integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=",
|
"integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"prettier": {
|
||||||
|
"version": "1.19.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
|
||||||
|
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew=="
|
||||||
|
},
|
||||||
|
"prettier-linter-helpers": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
|
||||||
|
"requires": {
|
||||||
|
"fast-diff": "^1.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"process-nextick-args": {
|
"process-nextick-args": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"dotenv": "^7.0.0",
|
"dotenv": "^7.0.0",
|
||||||
"ejs": "^2.6.1",
|
"ejs": "^2.6.1",
|
||||||
|
"eslint-plugin-prettier": "^3.1.2",
|
||||||
"express": "^4.16.4",
|
"express": "^4.16.4",
|
||||||
"express-ejs-layouts": "^2.5.0",
|
"express-ejs-layouts": "^2.5.0",
|
||||||
"express-layout": "^0.1.0",
|
"express-layout": "^0.1.0",
|
||||||
@@ -44,6 +45,7 @@
|
|||||||
"node-fetch": "^2.3.0",
|
"node-fetch": "^2.3.0",
|
||||||
"node-schedule": "^1.3.2",
|
"node-schedule": "^1.3.2",
|
||||||
"pg": "^7.10.0",
|
"pg": "^7.10.0",
|
||||||
|
"prettier": "^1.19.1",
|
||||||
"react-step-wizard": "^5.1.0",
|
"react-step-wizard": "^5.1.0",
|
||||||
"sequelize": "^5.18.4",
|
"sequelize": "^5.18.4",
|
||||||
"sequelize-cli": "^5.5.0"
|
"sequelize-cli": "^5.5.0"
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ if (urlToScrape) {
|
|||||||
})();
|
})();
|
||||||
} else {
|
} else {
|
||||||
console.log("No URL to scrape. Use like this : ");
|
console.log("No URL to scrape. Use like this : ");
|
||||||
console.log("npm run test-olx-scraper -- URL_TO_SCRAPE");
|
console.log("npm run test-rental-scraper -- URL_TO_SCRAPE");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user