From ab256bb09446dda14af0f2427612f7436e70c4dd Mon Sep 17 00:00:00 2001 From: Ida Date: Fri, 17 Apr 2026 14:10:18 +0200 Subject: [PATCH] bugfix(FIL-01 + files verschwunden nach hochladen und neuladen --- src/hooks/useFiles.ts | 10 +++++++++- src/pages/basedata/FilesPage.tsx | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/hooks/useFiles.ts b/src/hooks/useFiles.ts index 305c3d1..04306e8 100644 --- a/src/hooks/useFiles.ts +++ b/src/hooks/useFiles.ts @@ -480,7 +480,12 @@ export function useFileOperations() { * - Removed workflowId from FileItem creation in interfaceComponentObjects.py * - Upload should now work correctly */ - const handleFileUpload = async (file: globalThis.File, workflowId?: string, featureInstanceId?: string) => { + const handleFileUpload = async ( + file: globalThis.File, + workflowId?: string, + featureInstanceId?: string, + folderId?: string | null, + ) => { setUploadError(null); setUploadingFile(true); @@ -504,6 +509,9 @@ export function useFileOperations() { if (featureInstanceId) { formData.append('featureInstanceId', featureInstanceId); } + if (folderId) { + formData.append('folderId', folderId); + } // FormData is now correctly configured for backend diff --git a/src/pages/basedata/FilesPage.tsx b/src/pages/basedata/FilesPage.tsx index 7a6d4d8..60a4295 100644 --- a/src/pages/basedata/FilesPage.tsx +++ b/src/pages/basedata/FilesPage.tsx @@ -293,7 +293,7 @@ export const FilesPage: React.FC = () => { let successCount = 0; let errorCount = 0; for (const file of Array.from(picked)) { - const result = await handleFileUpload(file); + const result = await handleFileUpload(file, undefined, undefined, selectedFolderId); if (result?.success) successCount++; else errorCount++; } if (fileInputRef.current) fileInputRef.current.value = '';