Cleanup code, add basic functionality for Nests

This commit is contained in:
Matthew Penner 2021-01-01 15:55:30 -07:00
parent 6c85be72fa
commit 88ac1ce1fd
37 changed files with 331 additions and 159 deletions

View file

@ -32,18 +32,16 @@ class StartupController extends ApplicationApiController
* Update the startup and environment settings for a specific server.
*
* @param \Pterodactyl\Http\Requests\Api\Application\Servers\UpdateServerStartupRequest $request
* @return array
* @param \Pterodactyl\Models\Server $server
*
* @throws \Illuminate\Validation\ValidationException
* @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
* @return array
* @throws \Throwable
*/
public function index(UpdateServerStartupRequest $request): array
public function index(UpdateServerStartupRequest $request, Server $server): array
{
$server = $this->modificationService
->setUserLevel(User::USER_LEVEL_ADMIN)
->handle($request->getModel(Server::class), $request->validated());
->handle($server, $request->validated());
return $this->fractal->item($server)
->transformWith($this->getTransformer(ServerTransformer::class))