Add support for file copy and deletion
This commit is contained in:
parent
811026895b
commit
d79fe6982f
12 changed files with 173 additions and 53 deletions
13
resources/assets/scripts/api/server/files/deleteFile.ts
Normal file
13
resources/assets/scripts/api/server/files/deleteFile.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import http from "@/api/http";
|
||||
|
||||
/**
|
||||
* Deletes files and/or folders from the server. You should pass through an array of
|
||||
* file or folder paths to be deleted.
|
||||
*/
|
||||
export function deleteFile(server: string, location: string): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.post(`/api/client/servers/${server}/files/delete`, {location})
|
||||
.then(() => resolve())
|
||||
.catch(reject);
|
||||
})
|
||||
}
|
Reference in a new issue