Skip to content

Commit

Permalink
Passing proper config and params on product not found
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvautin committed Feb 7, 2018
1 parent d6bff84 commit 7037e18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ router.get('/product/:id', (req, res) => {
db.products.findOne({$or: [{_id: common.getId(req.params.id)}, {productPermalink: req.params.id}]}, (err, result) => {
// render 404 if page is not published
if(err){
res.render('error', {message: 'Product not found', helpers: req.handlebars.helpers});
res.render('error', {title: 'Not found', message: 'Product not found', helpers: req.handlebars.helpers, config});
}
if(err || result == null || result.productPublished === 'false'){
res.render('error', {message: 'Product not found', helpers: req.handlebars.helpers});
res.render('error', {title: 'Not found', message: 'Product not found', helpers: req.handlebars.helpers, config});
}else{
let productOptions = {};
if(result.productOptions){
Expand Down

0 comments on commit 7037e18

Please sign in to comment.