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, boards,
ReactiveCache.getUsers({ _id: { $in: userIds } }, { fields: Users.safeFields }, true), ReactiveCache.getUsers({ _id: { $in: userIds } }, { fields: Users.safeFields }, true),
Team.find({ _id: { $in: teamIds } }), Team.find({ _id: { $in: teamIds } }),
Org.find({ _id: { $in: orgIds } }), ReactiveCache.getOrgs({ _id: { $in: orgIds } }, {}, true),
] ]
return ret; return ret;
}); });

View file

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