From e1946c12f9a8346ee3e1f20652c15d03372b7601 Mon Sep 17 00:00:00 2001 From: juni-haukur <158475136+juni-haukur@users.noreply.github.com> Date: Mon, 23 Dec 2024 14:08:35 +0000 Subject: [PATCH] fix(application-inheritance-report): Fetch s3 filename from correct location (#17350) * fetch filename from correct location * remove console log --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../inheritance-report.service.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/libs/application/template-api-modules/src/lib/modules/templates/inheritance-report/inheritance-report.service.ts b/libs/application/template-api-modules/src/lib/modules/templates/inheritance-report/inheritance-report.service.ts index ca260f1cf23d..ba4b6c873d50 100644 --- a/libs/application/template-api-modules/src/lib/modules/templates/inheritance-report/inheritance-report.service.ts +++ b/libs/application/template-api-modules/src/lib/modules/templates/inheritance-report/inheritance-report.service.ts @@ -114,7 +114,12 @@ export class InheritanceReportService extends BaseTemplateApiService { attachments.push( ...(await Promise.all( answers.heirsAdditionalInfoPrivateTransferFiles.map(async (file) => { - const content = await this.getFileContentBase64(file.key) + const filename = ( + application.attachments as { + [key: string]: string + } + )[file.key] + const content = await this.getFileContentBase64(filename) return { name: file.name, content, @@ -128,7 +133,12 @@ export class InheritanceReportService extends BaseTemplateApiService { attachments.push( ...(await Promise.all( answers.heirsAdditionalInfoFilesOtherDocuments.map(async (file) => { - const content = await this.getFileContentBase64(file.key) + const filename = ( + application.attachments as { + [key: string]: string + } + )[file.key] + const content = await this.getFileContentBase64(filename) return { name: file.name, content, @@ -178,7 +188,10 @@ export class InheritanceReportService extends BaseTemplateApiService { ) return fileContent || '' } catch (e) { - this.logger.warn('[estate]: Failed to get file content - ', e) + this.logger.warn( + '[inherhitance-report]: Failed to get file content - ', + e, + ) return 'err' } }