Merge "fix: Fix delete swift folder"

This commit is contained in:
Zuul 2021-12-03 11:19:41 +00:00 committed by Gerrit Code Review
commit ee77a5eab3
3 changed files with 5 additions and 22 deletions

View File

@ -87,6 +87,9 @@ export default class BaseClient {
if (!id) {
return resourceName;
}
if (!resourceName) {
return id;
}
if (resourceName[resourceName.length - 1] === '/') {
return `${resourceName.substr(0, resourceName.length - 1)}/${id}`;
}

View File

@ -20,26 +20,6 @@ class SwiftClient extends Base {
return swiftBase();
}
get checkNameCode() {
return {
200: 'container exists',
401: 'user not login',
403: 'not allow to access this container',
404: 'not found this container',
500: 'other exception',
};
}
get checkNameCodeObject() {
return {
200: 'container exists',
401: 'user not login',
403: 'not allow to access this container',
404: 'not found this container',
500: 'other exception',
};
}
get projectInUrl() {
return true;
}

View File

@ -59,8 +59,8 @@ export default class Delete extends ConfirmAction {
return globalObjectStore.delete(data);
}
const store = new ObjectStore();
const { container, name: folder } = data;
const records = await store.fetchListByPage({ container, folder });
const { container, name } = data;
const records = await store.fetchList({ container, path: name });
if (records.length > 0) {
this.showConfirmErrorBeforeSubmit = true;
this.confirmErrorMessageBeforeSubmit = t(