Update API calls to Wings to only pass the required details with the changes to the installer system

This commit is contained in:
Dane Everitt 2021-08-29 14:09:43 -07:00
parent 869bc22103
commit e96ead4c4d
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 23 additions and 39 deletions

View file

@ -35,18 +35,18 @@ class DaemonServerRepository extends DaemonRepository
*
* @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException
*/
public function create(array $data): void
public function create(bool $startOnCompletion = true): void
{
Assert::isInstanceOf($this->server, Server::class);
try {
$this->getHttpClient()->post(
'/api/servers',
[
'json' => $data,
]
);
} catch (TransferException $exception) {
$this->getHttpClient()->post('/api/servers', [
'json' => [
'uuid' => $this->server->uuid,
'start_on_completion' => $startOnCompletion,
],
]);
} catch (GuzzleException $exception) {
throw new DaemonConnectionException($exception);
}
}