Pavle Golubovic 2 роки тому
джерело
коміт
c89b5dc396

+ 1
- 1
frontend/package.json Переглянути файл

@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "1.2.2",
"version": "1.2.4",
"private": true,
"dependencies": {
"@faceless-ui/slider": "^1.1.14",

+ 1
- 1
frontend/src/components/WorkClientForm.jsx Переглянути файл

@@ -136,7 +136,7 @@ const WorkClientForm = ({ data, download, onValidated, message, status }) => {
>
Subscribe and Download
</button>
<div className="text-sm text-right text-red-600">{message}</div>
<div className={"text-sm text-right" + (status === 'success' ? ' text-dg-primary-900' : ' text-red-600')}>{message}</div>
</div>
</div>
</div>

+ 5
- 16
frontend/src/pages/WorkWithUs.jsx Переглянути файл

@@ -73,24 +73,13 @@ const WorkWithUs = () => {
}, []);

function downloadFile(filePath) {
var link = document.createElement('a');
link.href = filePath;
link.download = filePath.substr(filePath.lastIndexOf('/') + 1);
link.click();
// var link = document.createElement('a');
// link.href = filePath;
// link.download = filePath.substr(filePath.lastIndexOf('/') + 1);
// link.click();
window.open(filePath.substr(filePath.lastIndexOf('/') + 1), "_blank");
}

const handleFileDownload = (url, filename) => {
fetch(url).then(response => {
return response.blob().then(blob => {
//console.log(blob);
//console.log(response.body);
console.log(blob.raw);
//fileDownload(response.headers.get('Content-Type'), blob);
//fileDownload(response.url, blob);
});
});
};

useEffect(() => {
formSuccess && downloadFile(download.downloadFilePath);
}, [formSuccess]);

Завантаження…
Відмінити
Зберегти