feat: Update agent report filename to use generated date (#2934)

This commit is contained in:
Sanju
2021-09-03 11:58:26 +05:30
committed by GitHub
parent ad83d1bb71
commit a03ed4eea0
3 changed files with 21 additions and 4 deletions

View File

@@ -73,7 +73,13 @@ export const actions = {
.then(response => {
let csvContent = 'data:text/csv;charset=utf-8,' + response.data;
var encodedUri = encodeURI(csvContent);
window.open(encodedUri);
var downloadLink = document.createElement('a');
downloadLink.href = encodedUri;
downloadLink.download = reportObj.fileName;
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);
})
.catch(error => {
console.error(error);