Explorar o código

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

Thanks to xet7 !

Fixes #4640
Lauri Ojansivu %!s(int64=2) %!d(string=hai) anos
pai
achega
c23f5dc858
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      models/attachments.js

+ 2 - 2
models/attachments.js

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