Skip to content

Commit

Permalink
Fixing issue 10
Browse files Browse the repository at this point in the history
  • Loading branch information
ravichandrasadineni committed Jan 19, 2014
1 parent 7108261 commit b893471
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 b893471

Please sign in to comment.