mirror of
https://github.com/wekan/wekan.git
synced 2025-12-22 02:10:12 +01:00
Move every Users.findOne() to the ReactiveCache
This commit is contained in:
parent
bf48d4371c
commit
6e1ef3d94a
35 changed files with 175 additions and 125 deletions
|
|
@ -1,12 +1,13 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
|
||||
Meteor.publish('team', function(query, limit) {
|
||||
check(query, Match.OneOf(Object, null));
|
||||
check(limit, Number);
|
||||
|
||||
if (!Match.test(this.userId, String)) {
|
||||
const user = ReactiveCache.getCurrentUser();
|
||||
if (!user) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const user = Users.findOne(this.userId);
|
||||
if (user && user.isAdmin) {
|
||||
return Team.find(query, {
|
||||
limit,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue