Files
old-web/app/controllers/vrsta_nekretnine.js
2019-04-16 06:27:11 +02:00

32 lines
654 B
JavaScript

const RealEstateRequest = require('../models/RealEstateRequest');
const vrsteNekretnina = [
{ ime: "Kuća", id: "kuca" },
{ ime: "Stan", id: "stan" },
{ ime: "Vikendica", id: "vikendica" }
]
const getVrstaNekretnine = (req,res) => {
res.render('vrsta_nekretnine', {
nextStep: '/',
vrste: vrsteNekretnina
});
}
const postVrstaNekretnine = (req, res) => {
RealEstateRequest.create({
real_estate_type: req.body.vrsta
}).then( (result) => {
res.send("Result is " + JSON.stringify(result));
}).catch( (e) => {
res.send(e);
});
}
module.exports = {
getVrstaNekretnine,
postVrstaNekretnine
};