mirror of
https://github.com/wekan/wekan.git
synced 2026-01-06 01:28:49 +01:00
Move every Org.findOne() to the ReactiveCache
This commit is contained in:
parent
79ea4d6d1e
commit
2ab34d3b87
4 changed files with 32 additions and 9 deletions
|
|
@ -43,6 +43,10 @@ ReactiveCacheServer = {
|
|||
const ret = Users.findOne(id);
|
||||
return ret;
|
||||
},
|
||||
getOrg(id) {
|
||||
const ret = Org.findOne(id);
|
||||
return ret;
|
||||
},
|
||||
getActivity(id) {
|
||||
const ret = Activities.findOne(id);
|
||||
return ret;
|
||||
|
|
@ -161,6 +165,16 @@ ReactiveCacheClient = {
|
|||
const ret = this.__user.get(id);
|
||||
return ret;
|
||||
},
|
||||
getOrg(id) {
|
||||
if (!this.__org) {
|
||||
this.__org = new DataCache(_id => {
|
||||
const _ret = Org.findOne(_id);
|
||||
return _ret;
|
||||
});
|
||||
}
|
||||
const ret = this.__org.get(id);
|
||||
return ret;
|
||||
},
|
||||
getActivity(id) {
|
||||
if (!this.__activity) {
|
||||
this.__activity = new DataCache(_id => {
|
||||
|
|
@ -290,6 +304,15 @@ ReactiveCache = {
|
|||
}
|
||||
return ret;
|
||||
},
|
||||
getOrg(id) {
|
||||
let ret;
|
||||
if (Meteor.isServer) {
|
||||
ret = ReactiveCacheServer.getOrg(id);
|
||||
} else {
|
||||
ret = ReactiveCacheClient.getOrg(id);
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
getActivity(id) {
|
||||
let ret;
|
||||
if (Meteor.isServer) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue