Jeg tror, at problemet findes i din jobs_controller.js
. Prøv at erstatte nedenstående kode
module.exports = function(app){
exports.createJob = function(req, res){
var job = new Job({created: Date.now});
job.set('title', req.body.title);
job.set('description', req.body.description);
job.set('hours', req.body.hours);
job.save(function(err){
if (err) {
alert(err);
}
else {
alert('Job Posted Succesfully');
}
});
}
};
med
exports.createJob = function(req, res){
var job = new Job({created: Date.now});
job.set('title', req.body.title);
job.set('description', req.body.description);
job.set('hours', req.body.hours);
job.save(function(err){
if (err) {
alert(err);
}
else {
alert('Job Posted Succesfully');
}
});
};
og sørg også for, at du sender svaret i stedet for at give besked.