mirror of
https://github.com/wekan/wekan.git
synced 2026-01-06 01:28:49 +01:00
Move every ChecklistItems.findOne() to the ReactiveCache
This commit is contained in:
parent
5e3a9dc059
commit
0e714a90e0
4 changed files with 26 additions and 3 deletions
|
|
@ -19,6 +19,10 @@ ReactiveCacheServer = {
|
|||
const ret = Checklists.findOne(id);
|
||||
return ret;
|
||||
},
|
||||
getChecklistItem(id) {
|
||||
const ret = ChecklistItems.findOne(id);
|
||||
return ret;
|
||||
},
|
||||
getCard(id) {
|
||||
const ret = Cards.findOne(id);
|
||||
return ret;
|
||||
|
|
@ -89,6 +93,16 @@ ReactiveCacheClient = {
|
|||
const ret = this.__checklist.get(id);
|
||||
return ret;
|
||||
},
|
||||
getChecklistItem(id) {
|
||||
if (!this.__checklistItem) {
|
||||
this.__checklistItem = new DataCache(_id => {
|
||||
const _ret = ChecklistItems.findOne(_id);
|
||||
return _ret;
|
||||
});
|
||||
}
|
||||
const ret = this.__checklistItem.get(id);
|
||||
return ret;
|
||||
},
|
||||
getCard(id) {
|
||||
if (!this.__card) {
|
||||
this.__card = new DataCache(cardId => {
|
||||
|
|
@ -194,6 +208,15 @@ ReactiveCache = {
|
|||
}
|
||||
return ret;
|
||||
},
|
||||
getChecklistItem(id) {
|
||||
let ret;
|
||||
if (Meteor.isServer) {
|
||||
ret = ReactiveCacheServer.getChecklistItem(id);
|
||||
} else {
|
||||
ret = ReactiveCacheClient.getChecklistItem(id);
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
getCard(id) {
|
||||
let ret;
|
||||
if (Meteor.isServer) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue