Add basic file deletion logic
This commit is contained in:
parent
ea9cdea08d
commit
6b4bf3eaa7
2 changed files with 64 additions and 2 deletions
14
resources/assets/scripts/api/server/files/deleteElement.ts
Normal file
14
resources/assets/scripts/api/server/files/deleteElement.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import {withCredentials} from "@/api/http";
|
||||
import {ServerApplicationCredentials} from "@/store/types";
|
||||
|
||||
/**
|
||||
* Deletes files and/or folders from the server. You should pass through an array of
|
||||
* file or folder paths to be deleted.
|
||||
*/
|
||||
export function deleteElement(server: string, credentials: ServerApplicationCredentials, items: Array<string>): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
withCredentials(server, credentials).post('/v1/server/file/delete', { items })
|
||||
.then(resolve)
|
||||
.catch(reject);
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue