From 13a6067081fff214625381f09d29cd3e53e218b5 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Wed, 16 Sep 2020 16:16:41 -0500 Subject: [PATCH] fixup! Ref: Avatars to use modern gridfs --- models/attachments.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/attachments.js b/models/attachments.js index ef376e0fc..5ebd731d5 100644 --- a/models/attachments.js +++ b/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'); });