Skip to content

Commit

Permalink
Merge pull request #3602 from FreeCodeCamp/fix/share-able-url-solutio…
Browse files Browse the repository at this point in the history
…n-undefined

fix shareable challenges solution undefined
  • Loading branch information
QuincyLarson committed Oct 6, 2015
2 parents bf4ccab + 85f2c00 commit 9bce039
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions server/boot/challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,13 @@ module.exports = function(app) {
}

if (dasherize(challenge.name) !== origChallengeName) {
return Observable.just(
'/challenges/' +
dasherize(challenge.name) +
'?solution=' +
encodeURIComponent(solutionCode)
);
let redirectUrl = `/challenges/${dasherize(challenge.name)}`;

if (solutionCode) {
redirectUrl += `?solution=${encodeURIComponent(solutionCode)}`;
}

return Observable.just(redirectUrl);
}

// save user does nothing if user does not exist
Expand Down

0 comments on commit 9bce039

Please sign in to comment.