change file names to CamelCase

This commit is contained in:
Bilal Catic
2019-05-16 19:40:26 +02:00
parent 616eddbb19
commit ab681e5eeb
3 changed files with 19 additions and 19 deletions

View File

@@ -1,19 +1,19 @@
const db = require('../models/index'); const db = require('../models/index');
const realEstateTypes = [ const realEstateTypes = [
{ ime: "Kuća", id: "kuca" }, { ime: "Kuća", id: "kuca" },
{ ime: "Stan", id: "stan" }, { ime: "Stan", id: "stan" },
{ ime: "Vikendica", id: "vikendica" } { ime: "Vikendica", id: "vikendica" }
]; ];
const getRealEstateTypes = (req,res) => { const getRealEstateTypes = (req,res) => {
const nextStep = req.query.nextStep; const nextStep = req.query.nextStep;
res.render('real_estate_type', { res.render('realEstateType', {
nextStep, nextStep,
realEstateTypes: realEstateTypes realEstateTypes: realEstateTypes
}); });
} };
const postRealEstateTypes = (req, res) => { const postRealEstateTypes = (req, res) => {
let nextStep = req.query.nextStep; let nextStep = req.query.nextStep;
@@ -21,14 +21,13 @@ const postRealEstateTypes = (req, res) => {
realEstateType: req.body.realestatetype realEstateType: req.body.realestatetype
}).then( (result) => { }).then( (result) => {
nextStep = nextStep || `/grad/${result.uniqueId}`; nextStep = nextStep || `/grad/${result.uniqueId}`;
res.redirect(nextStep); res.redirect(nextStep);
}).catch( (e) => { }).catch( (e) => {
res.send(e); res.send(e);
}); });
};
}
module.exports = { module.exports = {
getRealEstateTypes, getRealEstateTypes,
postRealEstateTypes postRealEstateTypes
}; };

View File

@@ -1,3 +1,4 @@
<!--suppress HtmlUnknownAnchorTarget -->
<div class="row center-align"> <div class="row center-align">
<h2>Koju nekretninu tražite?</h2> <h2>Koju nekretninu tražite?</h2>
</div> </div>
@@ -5,8 +6,8 @@
<form method="POST" id="form-real-estate-type"> <form method="POST" id="form-real-estate-type">
<div class="row center-align"> <div class="row center-align">
<ul class="collection with-header"> <ul class="collection with-header">
<% for(const realEstatetype of realEstateTypes) { %> <% for(const realEstatetype of realEstateTypes) { %>
<li class="collection-item" > <li class="collection-item" >
<div id="<%= realEstatetype.id %>" ><%= realEstatetype.ime %> <div id="<%= realEstatetype.id %>" ><%= realEstatetype.ime %>
<a href="#!" class="secondary-content"> <a href="#!" class="secondary-content">
<i class="material-icons">send</i> <i class="material-icons">send</i>
@@ -22,9 +23,9 @@
<script> <script>
$(document).ready( () => { $(document).ready( () => {
$(".collection-item").click( (e) => { $(".collection-item").click( (e) => {
const clickedId = $(e.target).attr("id"); const clickedId = $(e.target).attr("id");
$("#realestatetype").val(clickedId); $("#realestatetype").val(clickedId);
$("#form-real-estate-type").submit(); $("#form-real-estate-type").submit();
}); });
}); });
</script> </script>

View File

@@ -1,5 +1,5 @@
const welcome = require('./app/controllers/welcome').getWelcome; const welcome = require('./app/controllers/welcome').getWelcome;
const { getRealEstateTypes, postRealEstateTypes} = require('./app/controllers/real_estate_types'); const { getRealEstateTypes, postRealEstateTypes} = require('./app/controllers/realEstateTypes');
const { getCity, postCity } = require('./app/controllers/city'); const { getCity, postCity } = require('./app/controllers/city');
const { getNeighborhood, postgNeighborhood } = require('./app/controllers/neighborhoods'); const { getNeighborhood, postgNeighborhood } = require('./app/controllers/neighborhoods');
@@ -108,7 +108,7 @@ app.post("/api/payforalert", function(request, response) {
}); });
}); });
app.get('/', welcome); app.get('/', welcome);
app.get('/vrstanekretnine/:request_id', getRealEstateTypes); app.get('/vrstanekretnine/:request_id', getRealEstateTypes);
app.get('/vrstanekretnine', getRealEstateTypes); app.get('/vrstanekretnine', getRealEstateTypes);
@@ -122,6 +122,6 @@ app.get('/mjesto/:request_id', getNeighborhood);
app.post('/mjesto/:request_id', postgNeighborhood); app.post('/mjesto/:request_id', postgNeighborhood);
app.use('/assets', express.static('./app/public')) app.use('/assets', express.static('./app/public'));
app.listen(port, () => console.log(`Example app listening on port ${port}!`)); app.listen(port, () => console.log(`Example app listening on port ${port}!`));