Merge branch '14910-uploading-files-to-collection'
[arvados-workbench2.git] / src / common / webdav.ts
index 1a7da835c82a02c9ffaf3f2a524b3aea0cfd762e..a09e8fdd6de4a97aab496da4d3651446fee135f8 100644 (file)
@@ -28,12 +28,14 @@ export class WebDAV {
             data
         })
 
-    upload = (url: string, path: string, files: File[], config: WebDAVRequestConfig = {}) => {
-        return files.map(file => this.request({
-            ...config, url,
-            method: 'PUT',
-            data: file
-        }));
+    upload = (url: string, files: File[], config: WebDAVRequestConfig = {}) => {
+        return Promise.all(
+            files.map(file => this.request({
+                ...config, url,
+                method: 'PUT',
+                data: file
+            }))
+        );
     }
 
     copy = (url: string, destination: string, config: WebDAVRequestConfig = {}) =>