Răsfoiți Sursa

Server side code don't need a Meteor.call

Martin Filser 2 ani în urmă
părinte
comite
ea5025595a
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  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);
 
 
-      Meteor.call('validateAttachment', fileObjId);
+      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);
-        Meteor.defer(() => Meteor.call('moveAttachmentToStorage', fileObjId, storageDestination));
+        moveAttachmentToStorage(fileObjId, storageDestination);
       }
       }
     },
     },
   });
   });