Skip to content

Commit

Permalink
fix(challenges): creator should not join challenge automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
paglias committed May 21, 2018
1 parent 2cbc41d commit 17ada45
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions website/server/libs/challenges/index.js
Expand Up @@ -82,12 +82,10 @@ export async function createChallenge (user, req, res) {
addUserJoinChallengeNotification(user);

let results = await Promise.all([challenge.save({
validateBeforeSave: false, // already validate
}), group.save()]);
validateBeforeSave: false, // already validated
}), group.save(), user.save()]);
let savedChal = results[0];

await savedChal.syncToUser(user); // (it also saves the user)

return {savedChal, group};
}

Expand Down

0 comments on commit 17ada45

Please sign in to comment.