2
0
Эх сурвалжийг харах

fixup! Ref: Avatars to use modern gridfs

David Arnold 4 жил өмнө
parent
commit
13a6067081
1 өөрчлөгдсөн 4 нэмэгдсэн , 4 устгасан
  1. 4 4
      models/attachments.js

+ 4 - 4
models/attachments.js

@@ -32,8 +32,8 @@ const Attachments = new FilesCollection({
   debug: false, // Change to `true` for debugging
   collectionName: 'attachments',
   allowClientCode: false,
-  onAfterUpload(fileRef) {
-    createOnAfterUpload(attachmentBucket)(fileRef);
+  onAfterUpload: function onAfterUpload(fileRef) {
+    createOnAfterUpload(attachmentBucket).call(this, fileRef);
     // If the attachment doesn't have a source field
     // or its source is different than import
     if (!fileRef.meta.source || fileRef.meta.source !== 'import') {
@@ -42,8 +42,8 @@ const Attachments = new FilesCollection({
     }
   },
   interceptDownload: createInterceptDownload(attachmentBucket),
-  onAfterRemove(files) {
-    createOnAfterRemove(attachmentBucket)(files);
+  onAfterRemove: function onAfterRemove(files) {
+    createOnAfterRemove(attachmentBucket).call(this, files);
     files.forEach(fileObj => {
       insertActivity(fileObj, 'deleteAttachment');
     });