fix(server-api): cancelSubscription() is no longer called twice when user leaves group

This commit is contained in:
hamboomger
2020-03-31 18:23:08 +03:00
parent 0bc836b490
commit b7448e2cfe
3 changed files with 75 additions and 6 deletions
@@ -861,11 +861,6 @@ api.leaveGroup = {
if (guildIndex >= 0) user.guilds.splice(guildIndex, 1);
}
const isMemberOfGroupPlan = await user.isMemberOfGroupPlan();
if (!isMemberOfGroupPlan) {
await payments.cancelGroupSubscriptionForUser(user, group);
}
if (group.hasNotCancelled()) await group.updateGroupPlan(true);
res.respond(200, {});
},