Update project file download logic to use fetch POST request
This commit is contained in:
@@ -20,19 +20,15 @@ function ProjectManager() {
|
||||
const appState = useAppState();
|
||||
const projects = useProjectsList();
|
||||
|
||||
const downloadProjectFile = () => {
|
||||
const downloadProjectFile = async () => {
|
||||
if (!data?.projectFile) {
|
||||
return;
|
||||
}
|
||||
|
||||
const url = URL.createObjectURL(data.projectFile);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = data.projectFile.name;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
link.remove();
|
||||
URL.revokeObjectURL(url);
|
||||
await fetch('http://127.0.0.1:5174/project-05.tar', {
|
||||
method: 'POST',
|
||||
body: data.projectFile,
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user