Download certificate without redirect

This commit is contained in:
Rotimi Best
2023-08-16 08:32:53 +01:00
parent c5c36525af
commit e70ab42005
@@ -28,8 +28,15 @@
console.log(data);
const file = new Blob([data], { type: 'application/pdf' });
const fileURL = URL.createObjectURL(file);
let a = document.createElement('a');
document.body.append(a);
a.download = 'Certificate of Completion - ' + $currentOrg.name;
a.href = fileURL;
a.click();
a.remove();
isLoading = false;
window.open(fileURL);
};
</script>