mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04: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 = [
|
||||
boards,
|
||||
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),
|
||||
]
|
||||
return ret;
|
||||
|
|
|
@ -8,19 +8,22 @@ Meteor.publish('team', function(query, limit) {
|
|||
|
||||
let ret = [];
|
||||
if (user && user.isAdmin) {
|
||||
ret = Team.find(query, {
|
||||
limit,
|
||||
sort: { createdAt: -1 },
|
||||
fields: {
|
||||
teamDisplayName: 1,
|
||||
teamDesc: 1,
|
||||
teamShortName: 1,
|
||||
teamWebsite: 1,
|
||||
teams: 1,
|
||||
createdAt: 1,
|
||||
teamIsActive: 1,
|
||||
ret = ReactiveCache.getTeams(query,
|
||||
{
|
||||
limit,
|
||||
sort: { createdAt: -1 },
|
||||
fields: {
|
||||
teamDisplayName: 1,
|
||||
teamDesc: 1,
|
||||
teamShortName: 1,
|
||||
teamWebsite: 1,
|
||||
teams: 1,
|
||||
createdAt: 1,
|
||||
teamIsActive: 1,
|
||||
}
|
||||
},
|
||||
});
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue