From b12a462e3e789e63691dcc80d83002e2fe18ed74 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Tue, 31 Jan 2023 19:07:39 -0300 Subject: [PATCH] fix(core.gbapp): #195 bind call to provide min context for uploads. --- packages/core.gbapp/services/GBMinService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core.gbapp/services/GBMinService.ts b/packages/core.gbapp/services/GBMinService.ts index 6cd21996..d65165e8 100644 --- a/packages/core.gbapp/services/GBMinService.ts +++ b/packages/core.gbapp/services/GBMinService.ts @@ -1063,7 +1063,7 @@ export class GBMinService { const url = attachment.contentUrl; // https://github.com/GeneralBots/BotServer/issues/195 - '${botId}','uploads'); const localFolder = Path.join('work'); - const localFileName = Path.join(localFolder, attachment.name); + const localFileName = Path.join(localFolder, this['botId'],'uploads', attachment.name); try { let response; @@ -1156,7 +1156,7 @@ export class GBMinService { if (process.env.ENABLE_DOWNLOAD) { // Prepare Promises to download each attachment and then execute each Promise. - const promises = step.context.activity.attachments.map(GBMinService.downloadAttachmentAndWrite); + const promises = step.context.activity.attachments.map(GBMinService.downloadAttachmentAndWrite.bind(min)); const successfulSaves = await Promise.all(promises); async function replyForReceivedAttachments(localAttachmentData) { if (localAttachmentData) {