Added a new model - does not work yet

This commit is contained in:
Senad Uka
2019-04-16 06:27:11 +02:00
parent 2380c85122
commit c534c1ee34
5 changed files with 784 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
const RealEstateRequest = require('../models/RealEstateRequest');
const vrsteNekretnina = [
{ ime: "Kuća", id: "kuca" },
{ ime: "Stan", id: "stan" },
@@ -12,6 +14,18 @@ const getVrstaNekretnine = (req,res) => {
});
}
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
getVrstaNekretnine,
postVrstaNekretnine
};