Fix for old challenge names in account view so linking still works.
This commit is contained in:
@@ -147,10 +147,12 @@ exports.returnCurrentChallenge = function(req, res, next) {
|
||||
exports.returnIndividualChallenge = function(req, res, next) {
|
||||
var dashedName = req.params.challengeName;
|
||||
|
||||
var challengeName = dashedName.replace(/\-/g, ' ')
|
||||
.split(' ')
|
||||
.slice(1)
|
||||
.join(' ');
|
||||
var challengeName = /^(bonfire|waypoint)/.test(dashedName) ? dashedName
|
||||
.replace(/\-/g, ' ')
|
||||
.split(' ')
|
||||
.slice(1)
|
||||
.join(' ')
|
||||
: dashedName;
|
||||
|
||||
Challenge.find({'name': new RegExp(challengeName, 'i')},
|
||||
function(err, challengeFromMongo) {
|
||||
|
Reference in New Issue
Block a user