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 { sizes, getRealEstateTypeEnum } = require("../helpers/enums");
const { AD_CATEGORY } = require("../common/enums");
const getSize = (req, res) => {
const title = "Od koliko kvadrata tražite nekretninu ?";
@@ -24,7 +24,7 @@ const getSize = (req, res) => {
const postSize = async (req, res) => {
const searchRequest = await currentSearchRequest(req);
const realEstateType = getRealEstateTypeEnum(searchRequest.realEstateType);
const realEstateType = AD_CATEGORY[searchRequest.realEstateType];
const sizeMin = req.body.from || 0;
const sizeMax = req.body.to || 0;
//TODO: Validation, check if real estate type is valid, ...