Skip to content

Commit

Permalink
Merge pull request #11 from ravichandrasadineni/fix-for-Issue-10
Browse files Browse the repository at this point in the history
Fixing issue 10
  • Loading branch information
Lenny Markus committed Jan 20, 2014
2 parents 7108261 + b893471 commit f3024c4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions controllers/products.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,16 @@ module.exports = function (server) {

//Show it in console for educational purposes...
newProduct.whatAmI();

newProduct.save();
/* The call back recieves to more arguments ->product/s that is/are added to the database
and number of rows that are affected because of save, which right now are ignored
only errors object is consumed*/
newProduct.save(function(err) {
if(err) {
console.log('save error', err);
}

res.redirect('/products');
});
});

/**
Expand Down

0 comments on commit f3024c4

Please sign in to comment.