push rasad front on new repo

This commit is contained in:
2026-01-18 14:32:49 +03:30
commit 4fe6e70525
2139 changed files with 303150 additions and 0 deletions

26
src/data/download-file.js Normal file
View File

@@ -0,0 +1,26 @@
import axios from "axios";
export const downloadFile = (fileUrl) => {
axios({
url: fileUrl,
method: "GET",
responseType: "blob",
})
.then((response) => {
const blob = new Blob([response.data], {
type: response.headers["content-type"],
});
const url = window.URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = "filename.xlsx";
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
})
.catch((error) => {
console.error("Error downloading the file:", error);
});
};