Add deletion code to the panel

This commit is contained in:
Dane Everitt 2019-12-21 23:26:15 -08:00
parent 04d67eaa10
commit ef5d0fb4a2
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -72,11 +72,19 @@ class DaemonServerRepository extends DaemonRepository
} }
/** /**
* Delete a server from the daemon. * Delete a server from the daemon, forcibly if passed.
*
* @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException
*/ */
public function delete(): void public function delete(): void
{ {
throw new BadMethodCallException('Method is not implemented.'); Assert::isInstanceOf($this->server, Server::class);
try {
$this->getHttpClient()->delete('/api/servers/' . $this->server->uuid);
} catch (TransferException $exception) {
throw new DaemonConnectionException($exception);
}
} }
/** /**