Fixed bug related to map region edit
This commit is contained in:
@@ -9,9 +9,10 @@ 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}/${getMunicipalityName(request.region, req.body.municipality)}`;
|
||||
const nextStepParam = req.query.nextStep ? "?nextStep=" + req.query.nextStep : "";
|
||||
const nextStepUrl = `/${'naselje'}/${request.uniqueId}/${getMunicipalityName(request.region, req.body.municipality)}${nextStepParam}`;
|
||||
|
||||
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 || '/';
|
||||
|
||||
res.render('neighborhoodMap', {
|
||||
nextStep,
|
||||
municipality
|
||||
@@ -25,8 +24,11 @@ const postNeighborhood = async (req, res) => {
|
||||
]
|
||||
};
|
||||
await request.save();
|
||||
const nextStep = req.query.nextStep || `/povrsina/${request.uniqueId}`;
|
||||
res.redirect(nextStep);
|
||||
|
||||
const nextStepPage = req.query.nextStep || 'povrsina';
|
||||
const nextStepUrl = `/${nextStepPage}/${request.uniqueId}`;
|
||||
|
||||
res.redirect(nextStepUrl);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user