add ALL option to crawler cat, exclude from real estate types list

This commit is contained in:
Bilal Catic
2019-10-24 17:43:14 +02:00
parent 6fc4218e39
commit 5098b08b3f
2 changed files with 7 additions and 3 deletions

View File

@@ -70,6 +70,9 @@ const AD_TYPE = {
};
const AD_CATEGORY = {
ALL: {
id: "ALL"
},
FLAT: {
id: "FLAT",
title: "Stan",

View File

@@ -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 });
};