Move every Org.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory server/)

This commit is contained in:
Martin Filser 2023-03-12 18:14:55 +01:00
parent a4408b55ed
commit dcf7232958
2 changed files with 16 additions and 13 deletions

View file

@ -143,7 +143,7 @@ Meteor.publish('boardsReport', function() {
boards,
ReactiveCache.getUsers({ _id: { $in: userIds } }, { fields: Users.safeFields }, true),
Team.find({ _id: { $in: teamIds } }),
Org.find({ _id: { $in: orgIds } }),
ReactiveCache.getOrgs({ _id: { $in: orgIds } }, {}, true),
]
return ret;
});

View file

@ -8,7 +8,8 @@ Meteor.publish('org', function(query, limit) {
const user = ReactiveCache.getCurrentUser();
if (user && user.isAdmin) {
ret = Org.find(query, {
ret = ReactiveCache.getOrgs(query,
{
limit,
sort: { createdAt: -1 },
fields: {
@ -19,8 +20,10 @@ Meteor.publish('org', function(query, limit) {
orgTeams: 1,
createdAt: 1,
orgIsActive: 1,
}
},
});
true,
);
}
return ret;