async deleteFiles(collectionUuid: string, filePaths: string[]) {
for (const path of filePaths) {
- await this.webdavClient.delete(`c=${collectionUuid}${path}`);
+ const splittedPath = path.split('/');
+ if (collectionUuid) {
+ await this.webdavClient.delete(`c=${collectionUuid}/${splittedPath[1]}`);
+ } else {
+ await this.webdavClient.delete(`c=${collectionUuid}${path}`);
+ }
}
}
const baseUrl = this.webdavClient.defaults.baseURL.endsWith('/')
? this.webdavClient.defaults.baseURL.slice(0, -1)
: this.webdavClient.defaults.baseURL;
- const apiToken = this.authService.getApiToken();
- const splittedApiToken = apiToken ? apiToken.split('/') : [];
- const userApiToken = `/t=${splittedApiToken[2]}/`;
- const splittedPrevFileUrl = file.url.split('/');
- const url = `${baseUrl}/${splittedPrevFileUrl[1]}${userApiToken}${splittedPrevFileUrl[2]}`;
+ const apiToken = this.authService.getApiToken();
+ const splittedApiToken = apiToken ? apiToken.split('/') : [];
+ const userApiToken = `/t=${splittedApiToken[2]}/`;
+ const splittedPrevFileUrl = file.url.split('/');
+ const url = `${baseUrl}/${splittedPrevFileUrl[1]}${userApiToken}${splittedPrevFileUrl[2]}`;
return {
...file,
url
dispatch(progressIndicatorActions.START_WORKING(COLLECTION_PARTIAL_COPY_FORM_NAME));
const collection = await services.collectionService.get(currentCollection.uuid);
const collectionCopy = {
- ...collection,
name,
description,
ownerUuid: projectUuid,
- uuid: undefined
+ uuid: undefined,
+ manifestText: collection.manifestText,
};
const newCollection = await services.collectionService.create(collectionCopy);
const paths = filterCollectionFilesBySelection(state.collectionPanelFiles, false).map(file => file.id);