mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04:00
Move every Org.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory server/)
This commit is contained in:
parent
a4408b55ed
commit
dcf7232958
2 changed files with 16 additions and 13 deletions
|
@ -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;
|
||||
});
|
||||
|
|
|
@ -8,19 +8,22 @@ Meteor.publish('org', function(query, limit) {
|
|||
const user = ReactiveCache.getCurrentUser();
|
||||
|
||||
if (user && user.isAdmin) {
|
||||
ret = Org.find(query, {
|
||||
limit,
|
||||
sort: { createdAt: -1 },
|
||||
fields: {
|
||||
orgDisplayName: 1,
|
||||
orgDesc: 1,
|
||||
orgShortName: 1,
|
||||
orgWebsite: 1,
|
||||
orgTeams: 1,
|
||||
createdAt: 1,
|
||||
orgIsActive: 1,
|
||||
ret = ReactiveCache.getOrgs(query,
|
||||
{
|
||||
limit,
|
||||
sort: { createdAt: -1 },
|
||||
fields: {
|
||||
orgDisplayName: 1,
|
||||
orgDesc: 1,
|
||||
orgShortName: 1,
|
||||
orgWebsite: 1,
|
||||
orgTeams: 1,
|
||||
createdAt: 1,
|
||||
orgIsActive: 1,
|
||||
}
|
||||
},
|
||||
});
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue