Prevent creating a new database via the application API if server is at its limit; closes #2129
This commit is contained in:
parent
910a48ee8a
commit
b78aa180ea
6 changed files with 116 additions and 76 deletions
|
@ -69,9 +69,7 @@ class DatabaseController extends ClientApiController
|
|||
*/
|
||||
public function index(GetDatabasesRequest $request, Server $server): array
|
||||
{
|
||||
$databases = $this->repository->getDatabasesForServer($server->id);
|
||||
|
||||
return $this->fractal->collection($databases)
|
||||
return $this->fractal->collection($server->databases)
|
||||
->transformWith($this->getTransformer(DatabaseTransformer::class))
|
||||
->toArray();
|
||||
}
|
||||
|
@ -83,6 +81,8 @@ class DatabaseController extends ClientApiController
|
|||
* @param \Pterodactyl\Models\Server $server
|
||||
* @return array
|
||||
*
|
||||
* @throws \Throwable
|
||||
* @throws \Pterodactyl\Exceptions\Service\Database\TooManyDatabasesException
|
||||
* @throws \Pterodactyl\Exceptions\Service\Database\DatabaseClientFeatureNotEnabledException
|
||||
*/
|
||||
public function store(StoreDatabaseRequest $request, Server $server): array
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue