change controller file name to plural

This commit is contained in:
Bilal Catic
2019-05-16 19:42:15 +02:00
parent ab681e5eeb
commit c505062770
2 changed files with 6 additions and 7 deletions

26
app/controllers/cities.js Normal file
View File

@@ -0,0 +1,26 @@
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
};