Move every CustomFields.findOne(idOrFirstObjectSelector, options) to the ReactiveCache

This commit is contained in:
Martin Filser 2023-02-04 17:09:28 +01:00
parent 9e557f6887
commit 806ad78637
3 changed files with 5 additions and 5 deletions

View file

@ -372,14 +372,14 @@ class AdvancedFilter {
}
_fieldNameToId(field) {
const found = CustomFields.findOne({
const found = ReactiveCache.getCustomField({
name: field,
});
return found._id;
}
_fieldValueToId(field, value) {
const found = CustomFields.findOne({
const found = ReactiveCache.getCustomField({
name: field,
});
if (

View file

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

View file

@ -337,7 +337,7 @@ if (Meteor.isServer) {
Authentication.checkBoardAccess(req.userId, paramBoardId);
JsonRoutes.sendResult(res, {
code: 200,
data: CustomFields.findOne({
data: ReactiveCache.getCustomField({
_id: paramCustomFieldId,
boardIds: { $in: [paramBoardId] },
}),
@ -377,7 +377,7 @@ if (Meteor.isServer) {
boardIds: [board._id],
});
const customField = CustomFields.findOne({
const customField = ReactiveCache.getCustomField({
_id: id,
boardIds: { $in: [paramBoardId] },
});