mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Move every Checklists.findOne(idOrFirstObjectSelector, options) to the ReactiveCache
This commit is contained in:
parent
92733b24d1
commit
5552c17eba
3 changed files with 7 additions and 7 deletions
|
|
@ -303,7 +303,7 @@ if (Meteor.isServer) {
|
||||||
const paramChecklistId = req.params.checklistId;
|
const paramChecklistId = req.params.checklistId;
|
||||||
const paramCardId = req.params.cardId;
|
const paramCardId = req.params.cardId;
|
||||||
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
||||||
const checklist = Checklists.findOne({
|
const checklist = ReactiveCache.getChecklist({
|
||||||
_id: paramChecklistId,
|
_id: paramChecklistId,
|
||||||
cardId: paramCardId,
|
cardId: paramCardId,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ Checklists.helpers({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
itemIndex(itemId) {
|
itemIndex(itemId) {
|
||||||
const items = self.findOne({ _id: this._id }).items;
|
const items = ReactiveCache.getChecklist({ _id: this._id }).items;
|
||||||
return _.pluck(items, '_id').indexOf(itemId);
|
return _.pluck(items, '_id').indexOf(itemId);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -306,7 +306,7 @@ if (Meteor.isServer) {
|
||||||
const paramChecklistId = req.params.checklistId;
|
const paramChecklistId = req.params.checklistId;
|
||||||
const paramCardId = req.params.cardId;
|
const paramCardId = req.params.cardId;
|
||||||
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
||||||
const checklist = Checklists.findOne({
|
const checklist = ReactiveCache.getChecklist({
|
||||||
_id: paramChecklistId,
|
_id: paramChecklistId,
|
||||||
cardId: paramCardId,
|
cardId: paramCardId,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -275,21 +275,21 @@ RulesHelper = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (action.actionType === 'checkAll') {
|
if (action.actionType === 'checkAll') {
|
||||||
const checkList = Checklists.findOne({
|
const checkList = ReactiveCache.getChecklist({
|
||||||
title: action.checklistName,
|
title: action.checklistName,
|
||||||
cardId: card._id,
|
cardId: card._id,
|
||||||
});
|
});
|
||||||
checkList.checkAllItems();
|
checkList.checkAllItems();
|
||||||
}
|
}
|
||||||
if (action.actionType === 'uncheckAll') {
|
if (action.actionType === 'uncheckAll') {
|
||||||
const checkList = Checklists.findOne({
|
const checkList = ReactiveCache.getChecklist({
|
||||||
title: action.checklistName,
|
title: action.checklistName,
|
||||||
cardId: card._id,
|
cardId: card._id,
|
||||||
});
|
});
|
||||||
checkList.uncheckAllItems();
|
checkList.uncheckAllItems();
|
||||||
}
|
}
|
||||||
if (action.actionType === 'checkItem') {
|
if (action.actionType === 'checkItem') {
|
||||||
const checkList = Checklists.findOne({
|
const checkList = ReactiveCache.getChecklist({
|
||||||
title: action.checklistName,
|
title: action.checklistName,
|
||||||
cardId: card._id,
|
cardId: card._id,
|
||||||
});
|
});
|
||||||
|
|
@ -300,7 +300,7 @@ RulesHelper = {
|
||||||
checkItem.check();
|
checkItem.check();
|
||||||
}
|
}
|
||||||
if (action.actionType === 'uncheckItem') {
|
if (action.actionType === 'uncheckItem') {
|
||||||
const checkList = Checklists.findOne({
|
const checkList = ReactiveCache.getChecklist({
|
||||||
title: action.checklistName,
|
title: action.checklistName,
|
||||||
cardId: card._id,
|
cardId: card._id,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue