Replace server variable repository
This commit is contained in:
parent
860b2d890b
commit
7d8eba1595
5 changed files with 6 additions and 36 deletions
|
@ -4,8 +4,8 @@ namespace Pterodactyl\Http\Controllers\Api\Client\Servers;
|
|||
|
||||
use Pterodactyl\Models\Server;
|
||||
use Pterodactyl\Facades\Activity;
|
||||
use Pterodactyl\Models\ServerVariable;
|
||||
use Pterodactyl\Services\Servers\StartupCommandService;
|
||||
use Pterodactyl\Repositories\Eloquent\ServerVariableRepository;
|
||||
use Pterodactyl\Transformers\Api\Client\EggVariableTransformer;
|
||||
use Pterodactyl\Http\Controllers\Api\Client\ClientApiController;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
|
@ -17,10 +17,8 @@ class StartupController extends ClientApiController
|
|||
/**
|
||||
* StartupController constructor.
|
||||
*/
|
||||
public function __construct(
|
||||
private StartupCommandService $startupCommandService,
|
||||
private ServerVariableRepository $repository
|
||||
) {
|
||||
public function __construct(private StartupCommandService $startupCommandService)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,7 @@ class StartupController extends ClientApiController
|
|||
// Revalidate the variable value using the egg variable specific validation rules for it.
|
||||
$this->validate($request, ['value' => $variable->rules]);
|
||||
|
||||
$this->repository->updateOrCreate([
|
||||
ServerVariable::query()->updateOrCreate([
|
||||
'server_id' => $server->id,
|
||||
'variable_id' => $variable->id,
|
||||
], [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue