Blame view
imports/collections/users/publications.js
651 Bytes
39d8f536d
|
1 2 3 4 5 6 7 8 9 10 |
import { Meteor } from 'meteor/meteor'; import { check, Match } from 'meteor/check' import { Users } from '/imports/collections/users/index'; import { Orgs } from '/imports/collections/orgs/index'; Meteor.publish('users.current', function() { return Users.find({ _id: this.userId, |
39d8f536d
|
11 12 |
}); }); |
d0099dd88
|
13 14 15 16 17 18 19 20 21 22 |
Meteor.publish('users.forMyOrg', function() { const user = Users.findOne({_id: this.userId}); if(!user) return []; const org = Orgs.findOne({_id: user.orgId}); if(!org) return []; return Users.find({ orgId: user.orgId,role:"STUDENT" }); }); |