use single ENUMS; change old realEstateType enums

This commit is contained in:
Bilal Catic
2019-09-27 19:36:20 +02:00
parent d8d801d314
commit 6d7366f2c2
6 changed files with 22 additions and 86 deletions

View File

@@ -1,5 +1,5 @@
const { currentSearchRequest } = require("../helpers/url");
const { getRealEstateTypeEnum } = require("../helpers/enums");
const { AD_CATEGORY } = require("../common/enums");
const getGardenSize = (req, res) => {
const title = "Koliko okućnice tražite ?";
@@ -28,7 +28,7 @@ const postGardenSize = async (req, res) => {
const nextStepPage = req.query.nextStep || "cijena";
const nextStepUrl = `/${nextStepPage}/${searchRequest.id}`;
const realEstateType = getRealEstateTypeEnum(searchRequest.realEstateType);
const realEstateType = AD_CATEGORY[searchRequest.realEstateType];
if (realEstateType && realEstateType.hasGardenSize) {
const gardenSizeMin = req.body.from || 0;
const gardenSizeMax = req.body.to || 0;