Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing issue 10 #11

Merged
merged 1 commit into from
Jan 20, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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