mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-14 20:33:45 +02:00
Fix bad API behavior
This commit is contained in:
@@ -6,19 +6,6 @@ use Pterodactyl\Models\Node;
|
||||
|
||||
class UpdateNodeRequest extends StoreNodeRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the node being requested for editing exists
|
||||
* on the Panel before validating the data.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function resourceExists(): bool
|
||||
{
|
||||
$node = $this->route()->parameter('node');
|
||||
|
||||
return $node instanceof Node && $node->exists;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply validation rules to this request. Uses the parent class rules()
|
||||
* function but passes in the rules for updating rather than creating.
|
||||
@@ -28,7 +15,7 @@ class UpdateNodeRequest extends StoreNodeRequest
|
||||
*/
|
||||
public function rules(array $rules = null): array
|
||||
{
|
||||
$nodeId = $this->route()->parameter('node')->id;
|
||||
$nodeId = $this->getModel(Node::class)->id;
|
||||
|
||||
return parent::rules(Node::getUpdateRulesForId($nodeId));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user