apply prettier on all files

This commit is contained in:
Bilal Catic
2019-09-05 11:14:54 +02:00
parent 719cf4d8f9
commit 60e618fd22
45 changed files with 1749 additions and 1621 deletions

View File

@@ -1,10 +1,16 @@
const { currentRERequest } = require('../helpers/url');
const { getRegionName, getMunicipalityName } = require('../helpers/codes');
const { realEstateTypes, sizes, gardenSizes, prices, getEnumTypeTitle, getRealEstateTypeEnum } = require('../helpers/enums');
const { currentRERequest } = require("../helpers/url");
const { getRegionName, getMunicipalityName } = require("../helpers/codes");
const {
realEstateTypes,
sizes,
gardenSizes,
prices,
getEnumTypeTitle,
getRealEstateTypeEnum
} = require("../helpers/enums");
const getQueryReview = async (req,res) => {
const title = "Da li je ovo to što ste tražili ?"
const getQueryReview = async (req, res) => {
const title = "Da li je ovo to što ste tražili ?";
const request = await currentRERequest(req);
const nextStep = req.query.nextStep;
@@ -12,63 +18,73 @@ const getQueryReview = async (req,res) => {
return null;
}
const {
realEstateType,
region,
municipality,
sizeMin,
sizeMax,
gardenSizeMin,
gardenSizeMax,
priceMin,
priceMax } = request.dataValues;
const {
realEstateType,
region,
municipality,
sizeMin,
sizeMax,
gardenSizeMin,
gardenSizeMax,
priceMin,
priceMax
} = request.dataValues;
const realEstateTypeObject = getRealEstateTypeEnum(realEstateType);
const enableGardenSizeEdit = realEstateTypeObject ? realEstateTypeObject.hasGardenSize : false;
const enableGardenSizeEdit = realEstateTypeObject
? realEstateTypeObject.hasGardenSize
: false;
const realEstateTypeTitle = realEstateType ? getEnumTypeTitle(realEstateTypes, realEstateType) : null;
const realEstateTypeTitle = realEstateType
? getEnumTypeTitle(realEstateTypes, realEstateType)
: null;
const regionName = region ? getRegionName(region) : null;
const municipalityName = (region && municipality) ? getMunicipalityName(region, municipality) : null;
const municipalityName =
region && municipality ? getMunicipalityName(region, municipality) : null;
const sizeTitle = sizeMin ? sizeMin + "-" + sizeMax + " m2" : null;
const gardenSizeTitle = gardenSizeMin ? gardenSizeMin + "-" + gardenSizeMax + " m2" : null;
const priceTitle = priceMin ? priceMin + "-" + priceMax + " KM" : null;
const gardenSizeTitle = gardenSizeMin
? gardenSizeMin + "-" + gardenSizeMax + " m2"
: null;
const priceTitle = priceMin ? priceMin + "-" + priceMax + " KM" : null;
const uniqueId = request.dataValues.uniqueId ? request.dataValues.uniqueId : '';
const uniqueId = request.dataValues.uniqueId
? request.dataValues.uniqueId
: "";
const queryData = [
{
id: 'realEstateType',
id: "realEstateType",
title: realEstateTypeTitle,
url: `/vrstanekretnine/${uniqueId}?nextStep=pregled`,
url: `/vrstanekretnine/${uniqueId}?nextStep=pregled`
},
{
id: 'region',
id: "region",
title: regionName,
url: `/grad/${uniqueId}?nextStep=mjesto`,
url: `/grad/${uniqueId}?nextStep=mjesto`
},
{
id: 'municipality',
id: "municipality",
title: municipalityName,
url: `/mjesto/${uniqueId}?nextStep=pregled`,
url: `/mjesto/${uniqueId}?nextStep=pregled`
},
{
id: 'size',
id: "size",
title: sizeTitle,
url: `/povrsina/${uniqueId}?nextStep=pregled`,
url: `/povrsina/${uniqueId}?nextStep=pregled`
},
{
id: 'gardenSize',
id: "gardenSize",
title: gardenSizeTitle,
url: enableGardenSizeEdit ? `/okucnica/${uniqueId}?nextStep=pregled` : '',
url: enableGardenSizeEdit ? `/okucnica/${uniqueId}?nextStep=pregled` : ""
},
{
id: 'price',
id: "price",
title: priceTitle,
url: `/cijena/${uniqueId}?nextStep=pregled`
}
];
res.render('queryReview', {
res.render("queryReview", {
nextStep,
queryData,
title