Move every CardComments.findOne() to the ReactiveCache

This commit is contained in:
Martin Filser 2023-02-03 23:39:52 +01:00
parent 0e714a90e0
commit 0a7ffe4cb0
4 changed files with 27 additions and 4 deletions

View file

@ -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) {