From 5098b08b3f9bd92de123867736d120212b11719b Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Thu, 24 Oct 2019 17:43:14 +0200 Subject: [PATCH] add ALL option to crawler cat, exclude from real estate types list --- app/common/enums.js | 3 +++ app/controllers/realEstateTypes.js | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/common/enums.js b/app/common/enums.js index 1e46f03..1df898e 100644 --- a/app/common/enums.js +++ b/app/common/enums.js @@ -70,6 +70,9 @@ const AD_TYPE = { }; const AD_CATEGORY = { + ALL: { + id: "ALL" + }, FLAT: { id: "FLAT", title: "Stan", diff --git a/app/controllers/realEstateTypes.js b/app/controllers/realEstateTypes.js index 3b5f864..f021f04 100644 --- a/app/controllers/realEstateTypes.js +++ b/app/controllers/realEstateTypes.js @@ -5,9 +5,10 @@ const { AD_CATEGORY } = require("../common/enums"); const getRealEstateTypes = (req, res) => { const title = "Koju nekretninu tražite?"; - const realEstateTypes = Object.keys(AD_CATEGORY).map( - category => AD_CATEGORY[category] - ); + const realEstateTypes = Object.keys(AD_CATEGORY) + .map(category => AD_CATEGORY[category]) + .filter(category => category.title); + res.render("realEstateType", { realEstateTypes, title }); };