remove old request parameters and add location parameter to the review

This commit is contained in:
Bilal Catic
2019-09-10 07:44:43 +02:00
parent af908759bf
commit 13c462f328

View File

@@ -1,10 +1,6 @@
const { currentRERequest } = require("../helpers/url"); const { currentRERequest } = require("../helpers/url");
const { getRegionName, getMunicipalityName } = require("../helpers/codes");
const { const {
realEstateTypes, realEstateTypes,
sizes,
gardenSizes,
prices,
getEnumTypeTitle, getEnumTypeTitle,
getRealEstateTypeEnum getRealEstateTypeEnum
} = require("../helpers/enums"); } = require("../helpers/enums");
@@ -20,14 +16,13 @@ const getQueryReview = async (req, res) => {
const { const {
realEstateType, realEstateType,
region,
municipality,
sizeMin, sizeMin,
sizeMax, sizeMax,
gardenSizeMin, gardenSizeMin,
gardenSizeMax, gardenSizeMax,
priceMin, priceMin,
priceMax priceMax,
locationInput
} = request.dataValues; } = request.dataValues;
const realEstateTypeObject = getRealEstateTypeEnum(realEstateType); const realEstateTypeObject = getRealEstateTypeEnum(realEstateType);
@@ -38,9 +33,9 @@ const getQueryReview = async (req, res) => {
const realEstateTypeTitle = realEstateType const realEstateTypeTitle = realEstateType
? getEnumTypeTitle(realEstateTypes, realEstateType) ? getEnumTypeTitle(realEstateTypes, realEstateType)
: null; : null;
const regionName = region ? getRegionName(region) : null;
const municipalityName = const locationTitle = locationInput ? locationInput : "-";
region && municipality ? getMunicipalityName(region, municipality) : null;
const sizeTitle = sizeMin ? sizeMin + "-" + sizeMax + " m2" : null; const sizeTitle = sizeMin ? sizeMin + "-" + sizeMax + " m2" : null;
const gardenSizeTitle = gardenSizeMin const gardenSizeTitle = gardenSizeMin
? gardenSizeMin + "-" + gardenSizeMax + " m2" ? gardenSizeMin + "-" + gardenSizeMax + " m2"
@@ -58,14 +53,9 @@ const getQueryReview = async (req, res) => {
url: `/vrstanekretnine/${uniqueId}?nextStep=pregled` url: `/vrstanekretnine/${uniqueId}?nextStep=pregled`
}, },
{ {
id: "region", id: "location",
title: regionName, title: locationTitle,
url: `/grad/${uniqueId}?nextStep=mjesto` url: `/lokacija/${uniqueId}?nextStep=pregled`
},
{
id: "municipality",
title: municipalityName,
url: `/mjesto/${uniqueId}?nextStep=pregled`
}, },
{ {
id: "size", id: "size",