Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Meteor.methods({
- 'pushInfo': function(){
- if (this.userId) {
- userManagement.update({
- '_id': this.userId
- }, {
- $push: {
- 'activeInfos': ["The Info/Object I want to push from another collection"]
- }
- }
- );
- }
- }
- });
- Template.available.events({
- "click. push": function(e) {
- e.preventDefault();
- Meteor.call('pushInfo');
- }
- });
- Template.available.events({
- "click .push": function(e) {
- e.preventDefault();
- var InfoId = this.InfoId;
- Meteor.call('pushInfo', InfoId);
- }, });
- Meteor.methods({
- 'pushInfo': function(InfoId) {
- if (this.userId) {
- userManagement.update({
- '_id': this.userId
- }, {
- $push: {
- 'activeInfos': infoId
- }
- }
- );
- }
- }
- });
- Template.available.events({
- "click. push"(e) {
- e.preventDefault();
- Meteor.call('pushInfo',this.InfoId);
- }
- });
- Meteor.methods({
- 'pushInfo'(infoId)=>{
- const info = Infos.findOne(infoId)
- if (this.userId && info) {
- userManagement.update(this.userId, { $push: { activeInfos: info }});
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement