change column name from 'city' to 'region'

This commit is contained in:
Bilal Catic
2019-05-17 00:33:10 +02:00
parent 42505a7089
commit 4309bc709d
7 changed files with 49 additions and 30 deletions

View File

@@ -0,0 +1,25 @@
const { currentRERequest } = require('../helpers/url');
const { getRegions } = require('../helpers/codes');
const regions = getRegions();
const getRegion = (req,res) => {
const nextStep = req.query.nextStep || '/';
res.render('region', {
nextStep,
regions
});
};
const postRegion = async (req, res) => {
const request = await currentRERequest(req);
const nextStep = req.query.nextStep || `/mjesto/${request.uniqueId}`;
request.region = req.body.region;
await request.save();
res.redirect(nextStep)
};
module.exports = {
getRegion,
postRegion
};