mirror of
https://github.com/wekan/wekan.git
synced 2026-01-01 15:18:49 +01:00
Move every CardComments.findOne() to the ReactiveCache
This commit is contained in:
parent
0e714a90e0
commit
0a7ffe4cb0
4 changed files with 27 additions and 4 deletions
|
|
@ -27,6 +27,10 @@ ReactiveCacheServer = {
|
|||
const ret = Cards.findOne(id);
|
||||
return ret;
|
||||
},
|
||||
getCardComment(id) {
|
||||
const ret = CardComments.findOne(id);
|
||||
return ret;
|
||||
},
|
||||
getCustomField(id) {
|
||||
const ret = CustomFields.findOne(id);
|
||||
return ret;
|
||||
|
|
@ -113,6 +117,16 @@ ReactiveCacheClient = {
|
|||
const ret = this.__card.get(id);
|
||||
return ret;
|
||||
},
|
||||
getCardComment(id) {
|
||||
if (!this.__cardComment) {
|
||||
this.__cardComment = new DataCache(_id => {
|
||||
const _ret = CardComments.findOne(_id);
|
||||
return _ret;
|
||||
});
|
||||
}
|
||||
const ret = this.__cardComment.get(id);
|
||||
return ret;
|
||||
},
|
||||
getCustomField(id) {
|
||||
if (!this.__customField) {
|
||||
this.__customField = new DataCache(customFieldId => {
|
||||
|
|
@ -226,6 +240,15 @@ ReactiveCache = {
|
|||
}
|
||||
return ret;
|
||||
},
|
||||
getCardComment(id) {
|
||||
let ret;
|
||||
if (Meteor.isServer) {
|
||||
ret = ReactiveCacheServer.getCardComment(id);
|
||||
} else {
|
||||
ret = ReactiveCacheClient.getCardComment(id);
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
getCustomField(id) {
|
||||
let ret;
|
||||
if (Meteor.isServer) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue