api(application): v2 backport
This commit is contained in:
parent
4cd0bee231
commit
67bf3e342e
172 changed files with 2922 additions and 1579 deletions
|
@ -25,35 +25,31 @@ class ServerDetailsController extends ApplicationApiController
|
|||
/**
|
||||
* Update the details for a specific server.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\DisplayException
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function details(UpdateServerDetailsRequest $request, Server $server): array
|
||||
{
|
||||
$updated = $this->detailsModificationService->returnUpdatedModel()->handle(
|
||||
$server = $this->detailsModificationService->returnUpdatedModel()->handle(
|
||||
$server,
|
||||
$request->validated()
|
||||
);
|
||||
|
||||
return $this->fractal->item($updated)
|
||||
->transformWith($this->getTransformer(ServerTransformer::class))
|
||||
return $this->fractal->item($server)
|
||||
->transformWith(ServerTransformer::class)
|
||||
->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the build details for a specific server.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\DisplayException
|
||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function build(UpdateServerBuildConfigurationRequest $request, Server $server): array
|
||||
{
|
||||
$server = $this->buildModificationService->handle($server, $request->validated());
|
||||
|
||||
return $this->fractal->item($server)
|
||||
->transformWith($this->getTransformer(ServerTransformer::class))
|
||||
->transformWith(ServerTransformer::class)
|
||||
->toArray();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue