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