Files
old-web/app/controllers/vrsta_nekretnine.js

32 lines
628 B
JavaScript
Raw Normal View History

const db = require('../models/index');
2019-04-16 06:27:11 +02:00
2019-04-14 06:01:37 +02:00
const vrsteNekretnina = [
{ ime: "Kuća", id: "kuca" },
{ ime: "Stan", id: "stan" },
{ ime: "Vikendica", id: "vikendica" }
];
2019-04-14 06:01:37 +02:00
2019-03-26 05:06:15 +01:00
const getVrstaNekretnine = (req,res) => {
2019-04-14 06:01:37 +02:00
res.render('vrsta_nekretnine', {
nextStep: '/',
vrste: vrsteNekretnina
});
2019-03-26 05:06:15 +01:00
}
2019-04-16 06:27:11 +02:00
const postVrstaNekretnine = (req, res) => {
db.RealEstateRequest.create({
realEstateType: req.body.vrsta
2019-04-16 06:27:11 +02:00
}).then( (result) => {
res.send("Result is " + JSON.stringify(result));
}).catch( (e) => {
res.send(e);
2019-04-16 06:27:11 +02:00
});
}
2019-03-26 05:06:15 +01:00
module.exports = {
2019-04-16 06:27:11 +02:00
getVrstaNekretnine,
postVrstaNekretnine
2019-03-26 05:06:15 +01:00
};