Compare commits

..

2 Commits

Author SHA1 Message Date
Nedim Uka
f4baec23cf Fixed bug related to map region edit 2019-05-27 15:17:41 +02:00
Bilal Catic
5bf95e0594 Merge branch 'google-maps' into 'master'
Added google maps step

See merge request saburly/marketalarm/web!10
2019-05-27 08:35:04 +00:00
2 changed files with 8 additions and 5 deletions

View File

@@ -9,9 +9,10 @@ const getMunicipality = async (req, res) => {
}; };
const postMunicipality = async (req, res) => { const postMunicipality = async (req, res) => {
const request = await currentRERequest(req); const request = await currentRERequest(req);
const nextStepPage = req.query.nextStep || 'naselje'; const nextStepParam = req.query.nextStep ? "?nextStep=" + req.query.nextStep : "";
const nextStepUrl = `/${nextStepPage}/${request.uniqueId}/${getMunicipalityName(request.region, req.body.municipality)}`; const nextStepUrl = `/${'naselje'}/${request.uniqueId}/${getMunicipalityName(request.region, req.body.municipality)}${nextStepParam}`;
request.municipality = req.body.municipality; request.municipality = req.body.municipality;
await request.save(); await request.save();

View File

@@ -3,7 +3,6 @@ const { currentRERequest } = require('../helpers/url');
const getNeighborhood = async (req, res) => { const getNeighborhood = async (req, res) => {
const municipality = req.params.municipality const municipality = req.params.municipality
const nextStep = req.query.nextStep || '/'; const nextStep = req.query.nextStep || '/';
res.render('neighborhoodMap', { res.render('neighborhoodMap', {
nextStep, nextStep,
municipality municipality
@@ -25,8 +24,11 @@ const postNeighborhood = async (req, res) => {
] ]
}; };
await request.save(); 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 = { module.exports = {