bugfix(FIL-01 + files verschwunden nach hochladen und neuladen
This commit is contained in:
parent
238dd6ae16
commit
ab256bb094
2 changed files with 10 additions and 2 deletions
|
|
@ -480,7 +480,12 @@ export function useFileOperations() {
|
||||||
* - Removed workflowId from FileItem creation in interfaceComponentObjects.py
|
* - Removed workflowId from FileItem creation in interfaceComponentObjects.py
|
||||||
* - Upload should now work correctly
|
* - 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);
|
setUploadError(null);
|
||||||
setUploadingFile(true);
|
setUploadingFile(true);
|
||||||
|
|
||||||
|
|
@ -504,6 +509,9 @@ export function useFileOperations() {
|
||||||
if (featureInstanceId) {
|
if (featureInstanceId) {
|
||||||
formData.append('featureInstanceId', featureInstanceId);
|
formData.append('featureInstanceId', featureInstanceId);
|
||||||
}
|
}
|
||||||
|
if (folderId) {
|
||||||
|
formData.append('folderId', folderId);
|
||||||
|
}
|
||||||
|
|
||||||
// FormData is now correctly configured for backend
|
// FormData is now correctly configured for backend
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@ export const FilesPage: React.FC = () => {
|
||||||
let successCount = 0;
|
let successCount = 0;
|
||||||
let errorCount = 0;
|
let errorCount = 0;
|
||||||
for (const file of Array.from(picked)) {
|
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 (result?.success) successCount++; else errorCount++;
|
||||||
}
|
}
|
||||||
if (fileInputRef.current) fileInputRef.current.value = '';
|
if (fileInputRef.current) fileInputRef.current.value = '';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue