Update project file download logic to use fetch POST request

This commit is contained in:
2026-07-13 22:04:17 +02:00
parent 77139c57bd
commit 3d8e26ec0f

View File

@@ -20,19 +20,15 @@ function ProjectManager() {
const appState = useAppState(); const appState = useAppState();
const projects = useProjectsList(); const projects = useProjectsList();
const downloadProjectFile = () => { const downloadProjectFile = async () => {
if (!data?.projectFile) { if (!data?.projectFile) {
return; return;
} }
const url = URL.createObjectURL(data.projectFile); await fetch('http://127.0.0.1:5174/project-05.tar', {
const link = document.createElement('a'); method: 'POST',
link.href = url; body: data.projectFile,
link.download = data.projectFile.name; });
document.body.appendChild(link);
link.click();
link.remove();
URL.revokeObjectURL(url);
}; };
return ( return (