File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff 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"
Original file line number Diff line number Diff 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} ) ;
You can’t perform that action at this time.
0 commit comments