Implement collection service mvoeFile method
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Sat, 18 Aug 2018 09:21:39 +0000 (11:21 +0200)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Sat, 18 Aug 2018 09:21:39 +0000 (11:21 +0200)
Feature #14015

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

src/services/collection-service/collection-service.ts

index 671a1e1556155ba39529920e2be6e2f4b1d49bd6..576ba216f47964f3d64793262a0e2ab26ce6935e 100644 (file)
@@ -40,6 +40,13 @@ export class CollectionService extends CommonResourceService<CollectionResource>
         }
     }
 
+    moveFile(collectionUuid: string, oldPath: string, newPath: string) {
+        return this.webdavClient.move(
+            `/c=${collectionUuid}${oldPath}`,
+            `/c=${collectionUuid}${encodeURI(newPath)}`
+        );
+    }
+
     private extendFileURL = (file: CollectionDirectory | CollectionFile) => ({
         ...file,
         url: this.webdavClient.defaults.baseURL + file.url + '?api_token=' + this.authService.getApiToken()