Migrate to a monorepo structure (#2909)

This commit is contained in:
Charles Bochet
2023-12-10 18:10:54 +01:00
committed by GitHub
parent a70a9281eb
commit 5bdca9de6c
2304 changed files with 37152 additions and 25869 deletions

View File

@ -0,0 +1,18 @@
export const downloadFile = (fullPath: string, fileName: string) => {
fetch(process.env.REACT_APP_SERVER_BASE_URL + '/files/' + fullPath)
.then((resp) =>
resp.status === 200
? resp.blob()
: Promise.reject('Failed downloading file'),
)
.then((blob) => {
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.style.display = 'none';
a.href = url;
a.download = fileName;
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
});
};