You must first set the end date to null, then add the new plan
sferoze opened this issue · 0 comments
sferoze commented
There is an issue in the order of things done in this method
You must first update endDate, and then setAppPlansObject like so
// Update endDate to be null
Utility.updateAppPlansObject(options, planName, {
$unset: {
'appPlans.list.$.endDate': '',
},
});
Utility.setAppPlansObject(options, modifier);
return true;
Otherwise, the $addToSet modifier does not work and it adds duplicate plans with exact same parameters in the appPlans.list object