mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
mongoose: upgrade to 4.8.6 and remove un-necessary _.clone calls now that toObject clones correctly
This commit is contained in:
6
npm-shrinkwrap.json
generated
6
npm-shrinkwrap.json
generated
@@ -8617,9 +8617,9 @@
|
||||
"resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-2.1.8.tgz"
|
||||
},
|
||||
"mongoose": {
|
||||
"version": "4.8.5",
|
||||
"from": "mongoose@>=4.7.1 <5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-4.8.5.tgz",
|
||||
"version": "4.8.6",
|
||||
"from": "mongoose@4.8.6",
|
||||
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-4.8.6.tgz",
|
||||
"dependencies": {
|
||||
"async": {
|
||||
"version": "2.1.4",
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
"method-override": "^2.3.5",
|
||||
"moment": "^2.13.0",
|
||||
"moment-recur": "^1.0.5",
|
||||
"mongoose": "^4.7.1",
|
||||
"mongoose": "^4.8.6",
|
||||
"mongoose-id-autoinc": "~2013.7.14-4",
|
||||
"morgan": "^1.7.0",
|
||||
"nconf": "~0.8.2",
|
||||
|
||||
@@ -398,7 +398,7 @@ export function cron (options = {}) {
|
||||
|
||||
// After all is said and done, progress up user's effect on quest, return those values & reset the user's
|
||||
let progress = user.party.quest.progress;
|
||||
_progress = _.cloneDeep(progress.toObject()); // clone the old progress object
|
||||
_progress = progress.toObject(); // clone the old progress object
|
||||
progress.down = -1300;
|
||||
_.merge(progress, {down: 0, up: 0, collectedItems: 0});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user