Meteor.methods({
  addMilestone: function(data) {
    check(data, {
      type: String,
      parentId: Match.Optional(String),
      period: Match.Optional(String)
    });

    if (!this.userId) {
      throw new Meteor.Error(
        'forbidden-action',
        'Can\'t add milestone. User must be logged in.'
      );
    }

    const bounds = Milestones.boundsFor(
      moment(data.period),
      data.type
    );
    const milestone = _.extend(data, bounds, {userId: this.userId});

    return Milestones.insert(milestone);
  },

  copyMilestoneGoals: function(fromId, toId) {
    check(fromId, String);
    check(toId, String);
  }
});

@@ -627,16 +627,1190 @@
 String);
+%0A%0A    this.unblock();%0A%0A    if (!this.userId) %7B%0A      throw new Meteor.Error(%0A        'forbidden-action',%0A        'Can%5C't copy goals of parent milectone. User must be logged in.'%0A      );%0A    %7D%0A%0A    const parentMilestone = Milestones.findOne(%7B%0A      _id: fromId,%0A      userId: this.userId%0A    %7D);%0A    const childMilestone = Milestones.findOne(%7B%0A      _id: toId,%0A      userId: this.userId%0A    %7D);%0A%0A    if (!(parentMilestone && childMilestone)) %7B%0A      throw new Meteor.Error(%0A        'forbidden-action',%0A        %60Can%5C't copy goals of parent milectone.%0A        One or both of milestones are not found.%60%0A      );%0A    %7D%0A%0A    const parentGoals = Goals.find(%7B%0A      milestoneId: fromId,%0A      userId: this.userId,%0A      $or: %5B%0A        %7B completed: false %7D,%0A        %7B%0A          completed: %7B%0A            $exists: false%0A          %7D%0A        %7D%0A      %5D%0A    %7D);%0A%0A    return parentGoals.map(parentGoal =%3E %7B%0A      let childGoal = %7B%0A        title: parentGoal.title,%0A        parentId: parentGoal._id,%0A        milestoneId: toId,%0A        userId: parentGoal.userId,%0A        pctOfParentGoal: parentGoal.completedPct,%0A        completedPct: 0%0A      %7D;%0A%0A      return Goals.insert(childGoal);%0A    %7D);
 %0A  %7D%0A%7D);

Copy goals methods.