Blame view

imports/collections/parents/publications.js 547 Bytes
691a06c2f   ajaiprakash   Staff profile
1
2
3
4
5
6
7
8
9
10
11
12
  import { Meteor }                         from 'meteor/meteor';
  import { check, Match }                   from 'meteor/check'
  
  import { Orgs }                           from '/imports/collections/orgs/index';
  import { Users }                          from '/imports/collections/users/index';
  import { Parents }                        from '/imports/collections/parents/index';
  
  Meteor.publish('parent.forMyOrg', function () {
    const user = Users.findOne({_id: this.userId});
    if(!user) return [];
    return Parents.find({orgId: user.orgId});
  });