Przeglądaj źródła

Move every Attachments.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory models/)

Martin Filser 2 lat temu
rodzic
commit
fb3b47e2bb
2 zmienionych plików z 1 dodań i 3 usunięć
  1. 0 1
      models/cards.js
  2. 1 2
      models/exporter.js

+ 0 - 1
models/cards.js

@@ -588,7 +588,6 @@ Cards.helpers({
 
 
     // Copy attachments
     // Copy attachments
     oldCard.attachments()
     oldCard.attachments()
-      .map(att => att.get())
       .forEach(att => {
       .forEach(att => {
         copyFile(att, _id, fileStoreStrategyFactory);
         copyFile(att, _id, fileStoreStrategyFactory);
       });
       });

+ 1 - 2
models/exporter.js

@@ -77,8 +77,7 @@ export class Exporter {
     const byBoardAndAttachment = this._attachmentId
     const byBoardAndAttachment = this._attachmentId
       ? { boardId: this._boardId, _id: this._attachmentId }
       ? { boardId: this._boardId, _id: this._attachmentId }
       : byBoard;
       : byBoard;
-    result.attachments = Attachments.find(byBoardAndAttachment)
-      .fetch()
+    result.attachments = ReactiveCache.getAttachments(byBoardAndAttachment)
       .map((attachment) => {
       .map((attachment) => {
         let filebase64 = null;
         let filebase64 = null;
         filebase64 = getBase64DataSync(attachment);
         filebase64 = getBase64DataSync(attachment);