From 36d0bf2c656c5ff79c94216a8bfbed015bc84f7e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kuty=C5=82a?= Date: Tue, 1 Dec 2020 23:04:59 +0100 Subject: [PATCH] 17016: Fixed deleteFiles function MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła --- .../collection-service/collection-service.ts | 12 +++++++----- .../collection-panel-files-actions.ts | 5 +++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/services/collection-service/collection-service.ts b/src/services/collection-service/collection-service.ts index 0aa0aa84..7e6126a0 100644 --- a/src/services/collection-service/collection-service.ts +++ b/src/services/collection-service/collection-service.ts @@ -36,12 +36,14 @@ export class CollectionService extends TrashableResourceService b.length - a.length); + + for (const path of sortedUniquePaths) { + if (path.indexOf(collectionUuid) === -1) { await this.webdavClient.delete(`c=${collectionUuid}${path}`); + } else { + await this.webdavClient.delete(`c=${path}`); } } } diff --git a/src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts b/src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts index 3f9948fc..373ee04e 100644 --- a/src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts +++ b/src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts @@ -47,7 +47,8 @@ export const loadCollectionFiles = (uuid: string) => dispatch(snackbarActions.OPEN_SNACKBAR({ message: `Error getting file list: ${e.errors[0]}`, hideDuration: 2000, - kind: SnackbarKind.ERROR })); + kind: SnackbarKind.ERROR + })); }); }; @@ -149,7 +150,7 @@ export const renameFile = (newFullPath: string) => dispatch(loadCollectionPanel(currentCollection.uuid, true)); dispatch(dialogActions.CLOSE_DIALOG({ id: RENAME_FILE_DIALOG })); dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'File name changed.', hideDuration: 2000 })); - }).catch (e => { + }).catch(e => { const errors: FormErrors = { path: `Could not rename the file: ${e.responseText}` }; -- 2.30.2