mongoose: upgrade to 4.8.6 and remove un-necessary _.clone calls now that toObject clones correctly

This commit is contained in:
Matteo Pagliazzi
2017-03-07 14:16:14 +01:00
parent be60fb0635
commit 1a8f591251
4 changed files with 7 additions and 7 deletions

View File

@@ -114,7 +114,7 @@ api.addSubToGroupUser = async function addSubToGroupUser (member, group) {
if (member.hasNotCancelled()) await member.cancelSubscription();
let today = new Date();
plan = _.clone(member.purchased.plan.toObject());
plan = member.purchased.plan.toObject();
let extraMonths = Number(plan.extraMonths);
if (plan.dateTerminated) extraMonths += _dateDiff(today, plan.dateTerminated);
@@ -172,7 +172,7 @@ api.cancelGroupUsersSubscription = async function cancelGroupUsersSubscription (
api.cancelGroupSubscriptionForUser = async function cancelGroupSubscriptionForUser (user, group) {
if (user.purchased.plan.customerId !== this.constants.GROUP_PLAN_CUSTOMER_ID) return;
let userGroups = _.clone(user.guilds.toObject());
let userGroups = user.guilds.toObject();
userGroups.push('party');
let index = userGroups.indexOf(group._id);