remove save to user on return individual user
This commit is contained in:
@ -246,40 +246,29 @@ module.exports = function(app) {
|
|||||||
return Observable.just('/challenges/' + dasherize(challenge.name));
|
return Observable.just('/challenges/' + dasherize(challenge.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (challenge) {
|
// save user does nothing if user does not exist
|
||||||
if (req.user) {
|
return Observable.just({
|
||||||
req.user.currentChallenge = {
|
title: challenge.name,
|
||||||
challengeId: challenge.id,
|
dashedName: origChallengeName,
|
||||||
challengeName: challenge.name,
|
name: challenge.name,
|
||||||
dashedName: challenge.dashedName
|
details: challenge.description,
|
||||||
};
|
tests: challenge.tests,
|
||||||
}
|
challengeSeed: challenge.challengeSeed,
|
||||||
|
verb: utils.randomVerb(),
|
||||||
// save user does nothing if user does not exist
|
phrase: utils.randomPhrase(),
|
||||||
return saveUser(req.user)
|
compliment: utils.randomCompliment(),
|
||||||
.map(() => ({
|
challengeId: challenge.id,
|
||||||
title: challenge.name,
|
challengeType: challenge.challengeType,
|
||||||
dashedName: origChallengeName,
|
// video challenges
|
||||||
name: challenge.name,
|
video: challenge.challengeSeed[0],
|
||||||
details: challenge.description,
|
// bonfires specific
|
||||||
tests: challenge.tests,
|
difficulty: Math.floor(+challenge.difficulty),
|
||||||
challengeSeed: challenge.challengeSeed,
|
bonfires: challenge,
|
||||||
verb: utils.randomVerb(),
|
MDNkeys: challenge.MDNlinks,
|
||||||
phrase: utils.randomPhrase(),
|
MDNlinks: getMDNLinks(challenge.MDNlinks),
|
||||||
compliment: utils.randomCompliment(),
|
// htmls specific
|
||||||
challengeId: challenge.id,
|
environment: utils.whichEnvironment()
|
||||||
challengeType: challenge.challengeType,
|
});
|
||||||
// video challenges
|
|
||||||
video: challenge.challengeSeed[0],
|
|
||||||
// bonfires specific
|
|
||||||
difficulty: Math.floor(+challenge.difficulty),
|
|
||||||
bonfires: challenge,
|
|
||||||
MDNkeys: challenge.MDNlinks,
|
|
||||||
MDNlinks: getMDNLinks(challenge.MDNlinks),
|
|
||||||
// htmls specific
|
|
||||||
environment: utils.whichEnvironment()
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.subscribe(
|
.subscribe(
|
||||||
function(data) {
|
function(data) {
|
||||||
|
Reference in New Issue
Block a user