Blame view
imports/collections/staff/publications.js
543 Bytes
d75229d74
|
1 2 3 4 5 |
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'; |
ec5f044a9
|
6 |
import { Staffs } from '/imports/collections/staff/index'; |
d75229d74
|
7 |
|
ec5f044a9
|
8 |
Meteor.publish('staff.forMyOrg', function () { |
d75229d74
|
9 10 |
const user = Users.findOne({_id: this.userId}); if(!user) return []; |
ec5f044a9
|
11 |
return Staffs.find({orgId: user.orgId}); |
d75229d74
|
12 |
}); |