Skip to content

Commit de2344f

Browse files
committed
delete files
1 parent 0b0c018 commit de2344f

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

services/static-webserver/client/source/class/osparc/data/Resources.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,10 @@ qx.Class.define("osparc.data.Resources", {
12191219
method: "GET",
12201220
url: statics.API + "/storage/locations/{locationId}/paths?file_filter={path}&cursor={cursor}&size=1000"
12211221
},
1222+
batchDelete: {
1223+
method: "POST",
1224+
url: statics.API + "/storage/locations/{locationId}/-/paths:batchDelete"
1225+
},
12221226
requestSize: {
12231227
method: "POST",
12241228
url: statics.API + "/storage/locations/0/paths/{pathId}:size"

services/static-webserver/client/source/class/osparc/store/Data.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,24 @@ qx.Class.define("osparc.store.Data", {
257257
return data;
258258
})
259259
.catch(err => osparc.FlashMessenger.logError(err, this.tr("Unsuccessful file deletion")));
260-
}
260+
},
261+
262+
deleteFiles: function(items) {
263+
if (!osparc.data.Permissions.getInstance().canDo("study.node.data.delete", true)) {
264+
return null;
265+
}
266+
267+
const params = {
268+
url: {
269+
locationId: 0,
270+
},
271+
data: {
272+
items,
273+
}
274+
};
275+
return osparc.data.Resources.fetch("storagePaths", "batchDelete", params)
276+
.then(resp => console.log(resp))
277+
.catch(err => osparc.FlashMessenger.logError(err, this.tr("Unsuccessful files deletion")));
278+
},
261279
}
262280
});

0 commit comments

Comments
 (0)