fixup! Ref: Avatars to use modern gridfs

This commit is contained in:
David Arnold 2020-09-16 16:16:41 -05:00 committed by Denis Perov
parent 5e131f4c76
commit 4158334c2d

View file

@ -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');
});