Skip to content

Commit

Permalink
fix(application-inheritance-report): Fetch s3 filename from correct l…
Browse files Browse the repository at this point in the history
…ocation (#17350)

* fetch filename from correct location

* remove console log

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
juni-haukur and kodiakhq[bot] committed Dec 23, 2024
1 parent 9bb8115 commit e1946c1
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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'
}
}
Expand Down

0 comments on commit e1946c1

Please sign in to comment.