fix server deletion upon changing product

This commit is contained in:
ok236449 2023-04-12 20:51:08 +02:00
parent 20bd030e78
commit 821d85e395
2 changed files with 4 additions and 5 deletions

View file

@ -40,7 +40,7 @@ class ServerController extends Controller
foreach ($servers as $server) {
//Get server infos from ptero
$serverAttributes = $this->pterodactyl->getServerAttributes($server->pterodactyl_id, true);
$serverAttributes = $this->pterodactyl->getServerAttributes($server->pterodactyl_id);
if (! $serverAttributes) {
continue;
}
@ -351,9 +351,7 @@ class ServerController extends Controller
$server->update();
$server->allocation = $serverAttributes['allocation'];
$response = $this->pterodactyl->updateServer($server, $newProduct);
if ($response->failed()) {
return $this->serverCreationFailed($response, $server);
}
if ($response->failed()) return redirect()->route('servers.index')->with('error', __("The system was unable to update your server product. Please try again later or contact support."));
//update user balance
$user->decrement('credits', $priceupgrade);
//restart the server

View file

@ -460,5 +460,6 @@
"tr": "Turečtina",
"ru": "Ruština",
"sv": "Švédština",
"sk": "Slovensky"
"sk": "Slovensky",
"The system was unable to update your server product. Please try again later or contact support.": "Systém nebyl schopen změnit Váš balíček serveru. Prosím zkuste to znovu nebo kontaktujte podporu."
}