Cleaning up bonfire.js

This commit is contained in:
Nathan Leniz
2015-02-04 14:59:45 -05:00
parent e55a85a18c
commit c487ddf18e
2 changed files with 5 additions and 3 deletions

View File

@@ -73,7 +73,8 @@ exports.returnIndividualBonfire = function(req, res, next) {
if (err) {
next(err);
}
var dashedNameFull = bonfire[bonfireNumber].name.toLowerCase().replace(/\s/g, '-');
bonfire = bonfire.pop()
var dashedNameFull = bonfire.name.toLowerCase().replace(/\s/g, '-');
if (dashedNameFull != dashedName) {
return res.redirect('/bonfires/' + dashedNameFull);
}
@@ -83,7 +84,6 @@ exports.returnIndividualBonfire = function(req, res, next) {
});
return res.redirect('/bonfires')
} else {
bonfire = bonfire.pop();
res.render('bonfire/show', {
completedWith: null,
title: bonfire.name,