Преглед на файлове

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

Martin Filser преди 2 години
родител
ревизия
806ad78637
променени са 3 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. 2 2
      client/lib/filter.js
  2. 1 1
      models/cards.js
  3. 2 2
      models/customFields.js

+ 2 - 2
client/lib/filter.js

@@ -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 (

+ 1 - 1
models/cards.js

@@ -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,

+ 2 - 2
models/customFields.js

@@ -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] },
     });