skip to query review directly when editing data
This commit is contained in:
@@ -4,19 +4,20 @@ const { getMunicipalitiesForRegion } = require('../helpers/codes');
|
||||
const getMunicipality = async (req,res) => {
|
||||
let request = await currentRERequest(req);
|
||||
const municipalities = getMunicipalitiesForRegion(request.region);
|
||||
const nextStep = req.query.nextStep || '/';
|
||||
res.render('municipality', {
|
||||
nextStep,
|
||||
municipalities
|
||||
});
|
||||
|
||||
res.render('municipality', { municipalities });
|
||||
};
|
||||
|
||||
const postMunicipality = async (req, res) => {
|
||||
const request = await currentRERequest(req);
|
||||
const nextStep = req.query.nextStep || `/povrsina/${request.uniqueId}`;
|
||||
|
||||
const nextStepPage = req.query.nextStep || 'povrsina';
|
||||
const nextStepUrl = `/${nextStepPage}/${request.uniqueId}`;
|
||||
|
||||
request.municipality = req.body.municipality;
|
||||
await request.save();
|
||||
res.redirect(nextStep);
|
||||
|
||||
res.redirect(nextStepUrl);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user