mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02: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,
|
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;
|
||||||
});
|
});
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue