Files
pterodactyl-panel/resources/assets/scripts/api/server/files/deleteElement.ts
T

15 lines
570 B
TypeScript
Raw Normal View History

2019-03-09 12:04:29 -08:00
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.
*/
2019-03-10 18:42:53 -07:00
export function deleteElement(server: string, credentials: ServerApplicationCredentials, items: Array<string>): Promise<void> {
2019-03-09 12:04:29 -08:00
return new Promise((resolve, reject) => {
withCredentials(server, credentials).post('/v1/server/file/delete', { items })
2019-03-10 18:42:53 -07:00
.then(() => resolve())
2019-03-09 12:04:29 -08:00
.catch(reject);
})
}