Ver código fonte

Fix Validate attachment error at PR Meteor files 2.2.1 fixes + attachment view.

Thanks to xet7 !

Fixes #4640
Lauri Ojansivu 2 anos atrás
pai
commit
c23f5dc858
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      models/attachments.js

+ 2 - 2
models/attachments.js

@@ -192,13 +192,13 @@ if (Meteor.isServer) {
       check(fileObjId, String);
       check(fileObjId, String);
       check(storageDestination, String);
       check(storageDestination, String);
 
 
-      validateAttachment(fileObjId);
+      Meteor.defer(() => Meteor.call('validateAttachment', fileObjId));
 
 
       const fileObj = Attachments.findOne({_id: fileObjId});
       const fileObj = Attachments.findOne({_id: fileObjId});
 
 
       if (fileObj) {
       if (fileObj) {
         console.debug("Validation of uploaded file completed: file " + fileObj.path + " - storage destination " + storageDestination);
         console.debug("Validation of uploaded file completed: file " + fileObj.path + " - storage destination " + storageDestination);
-        moveAttachmentToStorage(fileObjId, storageDestination);
+        Meteor.defer(() => Meteor.call('moveAttachmentToStorage', fileObjId, storageDestination));
       }
       }
     },
     },
   });
   });