misc_pterodactyl-panel/resources/assets/scripts/api/server/files/deleteFile.ts

14 lines
436 B
TypeScript
Raw Normal View History

2019-05-05 00:26:24 +00:00
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);
})
}