diff --git a/citywalls2/controllers/streetController.js b/citywalls2/controllers/streetController.js index a5497e1..549f916 100644 --- a/citywalls2/controllers/streetController.js +++ b/citywalls2/controllers/streetController.js @@ -154,10 +154,18 @@ exports.houseDetails = asyncHandler(async (req, res) => { exports.filterPage = asyncHandler(async (req, res) => { const districtsCursor = await db.query('FOR house IN houses RETURN DISTINCT house.district'); const districts = await districtsCursor.all(); - + + const managementCompaniesCursor = await db.query('FOR house IN houses RETURN DISTINCT house.management_company'); + const managementCompanies = await managementCompaniesCursor.all(); + + const conditionsCursor = await db.query('FOR house IN houses RETURN DISTINCT house.condition'); + const conditions = await conditionsCursor.all(); + res.render('houses_filter', { title: 'Дома Санкт-Петербурга', districts, + managementCompanies, + conditions, }); }); diff --git a/citywalls2/data/houses.json b/citywalls2/data/houses.json index cc2e87f..a6d34f0 100644 --- a/citywalls2/data/houses.json +++ b/citywalls2/data/houses.json @@ -99,7 +99,7 @@ "floors": 27, "apartments": 803, "condition": "Исправный", - "management_company": "Комендантский, 13", + "management_company": "нет", "series": "индивидуальный", "district": "Приморский" }, @@ -138,7 +138,7 @@ "floors": 9, "apartments": 367, "condition": "Исправный", - "management_company": "Сиреневый 7-1", + "management_company": "нет", "series": "504", "district": "Выборгский" }, diff --git a/citywalls2/views/houses_filter.ejs b/citywalls2/views/houses_filter.ejs index 895cd80..c0775a6 100644 --- a/citywalls2/views/houses_filter.ejs +++ b/citywalls2/views/houses_filter.ejs @@ -10,6 +10,7 @@