Skip to content
Snippets Groups Projects
Commit 2a5ef74d authored by vkovtun's avatar vkovtun
Browse files

SSDM-13579: Fixed incorrect deletion when several files are selected.

parent a3c6c13f
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -69,28 +69,23 @@ export default class DataBrowserController extends ComponentController { ...@@ -69,28 +69,23 @@ export default class DataBrowserController extends ComponentController {
} }
async delete(paths) { async delete(paths) {
return new Promise((resolve, reject) => { for (const path of paths) {
const pathsLength = paths.length await this._delete(path)
let responsesCount = 0 }
let hasError = false
paths.forEach((path) => {
this.component.datastoreServer.delete(this.owner, path, async (success) => {
if (!success) {
hasError = true
}
if (++responsesCount === pathsLength) { if (this.gridController) {
if (this.gridController) { await this.gridController.load()
await this.gridController.load() }
} }
if (!hasError) { async _delete(path) {
resolve() return new Promise((resolve, reject) => {
} else { this.component.datastoreServer.delete(this.owner, path, async (success) => {
reject() if (success) {
} resolve()
} } else {
}) reject()
}
}) })
}) })
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment