Download certificate without redirect
This commit is contained in:
+8
-1
@@ -28,8 +28,15 @@
|
|||||||
console.log(data);
|
console.log(data);
|
||||||
const file = new Blob([data], { type: 'application/pdf' });
|
const file = new Blob([data], { type: 'application/pdf' });
|
||||||
const fileURL = URL.createObjectURL(file);
|
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;
|
isLoading = false;
|
||||||
window.open(fileURL);
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user