Fixed bounding box bug, and removed unecesary params
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const { currentRERequest } = require('../helpers/url');
|
||||
const { getMunicipalitiesForRegion } = require('../helpers/codes');
|
||||
const { getMunicipalitiesForRegion, getMunicipalityName } = require('../helpers/codes');
|
||||
|
||||
const getMunicipality = async (req, res) => {
|
||||
let request = await currentRERequest(req);
|
||||
@@ -10,9 +10,8 @@ const getMunicipality = async (req, res) => {
|
||||
|
||||
const postMunicipality = async (req, res) => {
|
||||
const request = await currentRERequest(req);
|
||||
|
||||
const nextStepPage = req.query.nextStep || 'naselje';
|
||||
const nextStepUrl = `/${nextStepPage}/${request.uniqueId}/${req.body.municipalityname}`;
|
||||
const nextStepUrl = `/${nextStepPage}/${request.uniqueId}/${getMunicipalityName(request.region, req.body.municipality)}`;
|
||||
|
||||
request.municipality = req.body.municipality;
|
||||
await request.save();
|
||||
|
||||
@@ -3,7 +3,6 @@ const { currentRERequest } = require('../helpers/url');
|
||||
const getNeighborhood = async (req, res) => {
|
||||
const municipality = req.params.municipality
|
||||
const nextStep = req.query.nextStep || '/';
|
||||
console.log(municipality);
|
||||
|
||||
res.render('neighborhoodMap', {
|
||||
nextStep,
|
||||
@@ -14,10 +13,10 @@ const getNeighborhood = async (req, res) => {
|
||||
|
||||
const postNeighborhood = async (req, res) => {
|
||||
let request = await currentRERequest(req);
|
||||
const northWest = [req.body.north, req.body.west];
|
||||
const northEast = [req.body.north, req.body.east];
|
||||
const southEast = [req.body.south, req.body.east];
|
||||
const southWest = [req.body.south, req.body.west];
|
||||
const northWest = [req.body.west, req.body.north];
|
||||
const northEast = [req.body.east, req.body.north];
|
||||
const southEast = [req.body.east, req.body.south];
|
||||
const southWest = [req.body.west, req.body.south];
|
||||
|
||||
request.bounding_box = {
|
||||
type: 'Polygon', coordinates: [
|
||||
|
||||
Reference in New Issue
Block a user