mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Fix 9248: challenge creator should not automatically join their own challenge (#10383)
* fix(challenges): creator should not join challenge automatically * change behavior on the client side as well * update tests and fix membercount * update tests * fix tests
This commit is contained in:
@@ -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};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user