From 513dc33a512382a197b6ef22536bef498ac79020 Mon Sep 17 00:00:00 2001 From: ykoeth Date: Mon, 17 Oct 2022 19:30:49 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=94=20Improve=20AWS=20S3=20documentati?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing callback in the remove monkeypatching --- docs/aws-s3-integration.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/aws-s3-integration.md b/docs/aws-s3-integration.md index 8e40339..7e601be 100644 --- a/docs/aws-s3-integration.md +++ b/docs/aws-s3-integration.md @@ -228,8 +228,8 @@ if (s3Conf && s3Conf.key && s3Conf.secret && s3Conf.bucket && s3Conf.region) { // Intercept FilesCollection's remove method to remove file from AWS:S3 const _origRemove = UserFiles.remove; - UserFiles.remove = function (search) { - const cursor = this.collection.find(search); + UserFiles.remove = function (selector, callback) { + const cursor = this.collection.find(selector); cursor.forEach((fileRef) => { _.each(fileRef.versions, (vRef) => { if (vRef && vRef.meta && vRef.meta.pipePath) { @@ -248,8 +248,8 @@ if (s3Conf && s3Conf.key && s3Conf.secret && s3Conf.bucket && s3Conf.region) { }); }); - //remove original file from database - _origRemove.call(this, search); + // Remove original file from database + _origRemove.call(this, selector, callback); }; } else { throw new Meteor.Error(401, 'Missing Meteor file settings');