Move every CustomFields.findOne() to the ReactiveCache

This commit is contained in:
Martin Filser 2023-02-03 23:58:38 +01:00
parent 0a7ffe4cb0
commit 54f7361767
4 changed files with 5 additions and 5 deletions

View file

@ -159,7 +159,7 @@ BlazeComponent.extendComponent({
},
lastCustomField() {
const lastCustomField = CustomFields.findOne(
const lastCustomField = ReactiveCache.getCustomField(
this.currentData().activity.customFieldId,
);
if (!lastCustomField) return null;
@ -167,7 +167,7 @@ BlazeComponent.extendComponent({
},
lastCustomFieldValue() {
const lastCustomField = CustomFields.findOne(
const lastCustomField = ReactiveCache.getCustomField(
this.currentData().activity.customFieldId,
);
if (!lastCustomField) return null;

View file

@ -275,7 +275,7 @@ const CreateCustomFieldPopup = BlazeComponent.extendComponent({
'click .js-delete-custom-field': Popup.afterConfirm(
'deleteCustomField',
function() {
const customField = CustomFields.findOne(this._id);
const customField = ReactiveCache.getCustomField(this._id);
if (customField.boardIds.length > 1) {
CustomFields.update(customField._id, {
$pull: {

View file

@ -56,7 +56,7 @@ Activities.helpers({
return ReactiveCache.getCard(this.subtaskId);
},
customField() {
return CustomFields.findOne(this.customFieldId);
return ReactiveCache.getCustomField(this.customFieldId);
},
// Label activity did not work yet, unable to edit labels when tried this.
//label() {

View file

@ -532,7 +532,7 @@ Cards.helpers({
mapCustomFieldsToBoard(boardId) {
// Map custom fields to new board
return this.customFields.map(cf => {
const oldCf = CustomFields.findOne(cf._id);
const oldCf = ReactiveCache.getCustomField(cf._id);
const newCf = CustomFields.findOne({
boardIds: boardId,
name: oldCf.name,