Renaming to english

This commit is contained in:
Nedim Uka
2019-05-15 15:27:10 +02:00
parent 9fdfce49ed
commit 27fa721627
16 changed files with 153 additions and 131 deletions

27
app/controllers/city.js Normal file
View File

@@ -0,0 +1,27 @@
const db = require('../models/index');
const { currentRERequest } = require('../helpers/url');
const { regions } = require('../helpers/codes');
const cities = regions();
const getCity = (req,res) => {
const nextStep = req.query.nextStep || '/';
res.render('city', {
nextStep,
cities
});
}
const postCity = async (req, res) => {
const request = await currentRERequest(req);
const nextStep = req.query.nextStep || `/mjesto/${request.uniqueId}`;
request.city = req.body.city;
await request.save();
res.redirect(nextStep)
}
module.exports = {
getCity,
postCity
};