Skip to content

Commit 5718d79

Browse files
committed
updates
1 parent 7cb15c9 commit 5718d79

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

components/freshdesk/actions/download-attachment/download-attachment.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,12 @@ export default {
5151
});
5252
const attachment = attachments.find(({ id }) => id === this.attachmentId);
5353

54-
const resppnse = await axios($, {
54+
const response = await axios($, {
5555
url: attachment.attachment_url,
5656
responseType: "arraybuffer",
5757
});
5858

59-
const rawcontent = resppnse.toString("base64");
60-
const buffer = Buffer.from(rawcontent, "base64");
59+
const buffer = Buffer.from(response);
6160
const downloadedFilepath = `/tmp/${attachment.name}`;
6261
fs.writeFileSync(downloadedFilepath, buffer);
6362

0 commit comments

Comments
 (0)