return Promise.reject();
}
- async deleteFile(collectionUuid: string, filePath: string) {
- return this.webdavClient.delete(`/c=${collectionUuid}${filePath}`);
+ async deleteFiles(collectionUuid: string, filePaths: string[]) {
+ for (const path of filePaths) {
+ await this.webdavClient.delete(`/c=${collectionUuid}${path}`);
+ }
}
async uploadFiles(collectionUuid: string, files: File[], onProgress?: UploadProgress) {
}
}
+ 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()