change file names to CamelCase
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
const db = require('../models/index');
|
||||
|
||||
const realEstateTypes = [
|
||||
{ ime: "Kuća", id: "kuca" },
|
||||
{ ime: "Stan", id: "stan" },
|
||||
{ ime: "Kuća", id: "kuca" },
|
||||
{ ime: "Stan", id: "stan" },
|
||||
{ ime: "Vikendica", id: "vikendica" }
|
||||
];
|
||||
|
||||
|
||||
const getRealEstateTypes = (req,res) => {
|
||||
const nextStep = req.query.nextStep;
|
||||
res.render('real_estate_type', {
|
||||
nextStep,
|
||||
realEstateTypes: realEstateTypes
|
||||
const nextStep = req.query.nextStep;
|
||||
res.render('realEstateType', {
|
||||
nextStep,
|
||||
realEstateTypes: realEstateTypes
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const postRealEstateTypes = (req, res) => {
|
||||
let nextStep = req.query.nextStep;
|
||||
@@ -21,14 +21,13 @@ const postRealEstateTypes = (req, res) => {
|
||||
realEstateType: req.body.realestatetype
|
||||
}).then( (result) => {
|
||||
nextStep = nextStep || `/grad/${result.uniqueId}`;
|
||||
res.redirect(nextStep);
|
||||
res.redirect(nextStep);
|
||||
}).catch( (e) => {
|
||||
res.send(e);
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
module.exports = {
|
||||
getRealEstateTypes,
|
||||
postRealEstateTypes
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
<!--suppress HtmlUnknownAnchorTarget -->
|
||||
<div class="row center-align">
|
||||
<h2>Koju nekretninu tražite?</h2>
|
||||
</div>
|
||||
@@ -5,8 +6,8 @@
|
||||
<form method="POST" id="form-real-estate-type">
|
||||
<div class="row center-align">
|
||||
<ul class="collection with-header">
|
||||
<% for(const realEstatetype of realEstateTypes) { %>
|
||||
<li class="collection-item" >
|
||||
<% for(const realEstatetype of realEstateTypes) { %>
|
||||
<li class="collection-item" >
|
||||
<div id="<%= realEstatetype.id %>" ><%= realEstatetype.ime %>
|
||||
<a href="#!" class="secondary-content">
|
||||
<i class="material-icons">send</i>
|
||||
@@ -22,9 +23,9 @@
|
||||
<script>
|
||||
$(document).ready( () => {
|
||||
$(".collection-item").click( (e) => {
|
||||
const clickedId = $(e.target).attr("id");
|
||||
const clickedId = $(e.target).attr("id");
|
||||
$("#realestatetype").val(clickedId);
|
||||
$("#form-real-estate-type").submit();
|
||||
$("#form-real-estate-type").submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user