feat: update triggerDownload function to accept file extension parameter

This commit is contained in:
Andrej
2025-12-01 19:37:06 +01:00
parent 3a9f9c0d58
commit ddf6787b76
3 changed files with 5 additions and 5 deletions

View File

@@ -1,8 +1,8 @@
export function triggerDownload(file: Blob, file_name: string) {
export function triggerDownload(file: Blob, file_name: string, ext: string) {
const url = window.URL.createObjectURL(file);
const link = document.createElement('a');
link.href = url;
link.download = `${file_name}.pdf`;
link.download = `${file_name}.${ext}`;
link.target = "_blank";
link.click();
window.URL.revokeObjectURL(url);