This commit is contained in:
Adria Navarro 2024-03-27 12:57:20 +01:00
parent fb8163193c
commit c7c652825b
2 changed files with 5 additions and 5 deletions

View File

@ -57,8 +57,8 @@
<DrawerBindableInput <DrawerBindableInput
title="File name" title="File name"
{bindings} {bindings}
value={parameters.file_name} value={parameters.fileName}
on:change={value => (parameters.file_name = value.detail)} on:change={value => (parameters.fileName = value.detail)}
/> />
{/if} {/if}
</div> </div>

View File

@ -402,11 +402,11 @@ const closeSidePanelHandler = () => {
const downloadFileHandler = async (action, _context) => { const downloadFileHandler = async (action, _context) => {
try { try {
let { url, file_name, type, attachment } = action.parameters let { url, fileName, type, attachment } = action.parameters
if (type === "attachment") { if (type === "attachment") {
const attachmentObject = JSON.parse(attachment) const attachmentObject = JSON.parse(attachment)
url = attachmentObject.url url = attachmentObject.url
file_name = attachmentObject.name fileName = attachmentObject.name
} }
const response = await fetch(url) const response = await fetch(url)
@ -419,7 +419,7 @@ const downloadFileHandler = async (action, _context) => {
const link = document.createElement("a") const link = document.createElement("a")
link.href = objectUrl link.href = objectUrl
link.download = file_name link.download = fileName
link.click() link.click()
URL.revokeObjectURL(objectUrl) URL.revokeObjectURL(objectUrl)