mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 16:30:13 +01:00
Move every Team.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory server/)
This commit is contained in:
parent
dcf7232958
commit
99ab6d13d4
2 changed files with 16 additions and 13 deletions
|
|
@ -142,7 +142,7 @@ Meteor.publish('boardsReport', function() {
|
||||||
const ret = [
|
const ret = [
|
||||||
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 } }),
|
ReactiveCache.getTeams({ _id: { $in: teamIds } }, {}, true),
|
||||||
ReactiveCache.getOrgs({ _id: { $in: orgIds } }, {}, true),
|
ReactiveCache.getOrgs({ _id: { $in: orgIds } }, {}, true),
|
||||||
]
|
]
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@ Meteor.publish('team', function(query, limit) {
|
||||||
|
|
||||||
let ret = [];
|
let ret = [];
|
||||||
if (user && user.isAdmin) {
|
if (user && user.isAdmin) {
|
||||||
ret = Team.find(query, {
|
ret = ReactiveCache.getTeams(query,
|
||||||
|
{
|
||||||
limit,
|
limit,
|
||||||
sort: { createdAt: -1 },
|
sort: { createdAt: -1 },
|
||||||
fields: {
|
fields: {
|
||||||
|
|
@ -19,8 +20,10 @@ Meteor.publish('team', function(query, limit) {
|
||||||
teams: 1,
|
teams: 1,
|
||||||
createdAt: 1,
|
createdAt: 1,
|
||||||
teamIsActive: 1,
|
teamIsActive: 1,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
true,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue