api(application): relocate egg endpoints

This commit is contained in:
Matthew Penner 2021-01-08 09:25:40 -07:00
parent 5946210e18
commit 58cfa98b9c
23 changed files with 309 additions and 112 deletions

View file

@ -19,7 +19,7 @@ class DeleteNestRequest extends ApplicationApiRequest
protected $permission = AdminAcl::WRITE;
/**
* Determine if the requested role exists on the Panel.
* Determine if the requested nest exists on the Panel.
*
* @return bool
*/

View file

@ -1,31 +0,0 @@
<?php
namespace Pterodactyl\Http\Requests\Api\Application\Nests\Eggs;
use Pterodactyl\Models\Egg;
use Pterodactyl\Models\Nest;
use Pterodactyl\Services\Acl\Api\AdminAcl;
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
class GetEggRequest extends ApplicationApiRequest
{
/**
* @var string
*/
protected $resource = AdminAcl::RESOURCE_EGGS;
/**
* @var int
*/
protected $permission = AdminAcl::READ;
/**
* Determine if the requested egg exists for the selected nest.
*
* @return bool
*/
public function resourceExists(): bool
{
return $this->getModel(Nest::class)->id === $this->getModel(Egg::class)->nest_id;
}
}

View file

@ -1,19 +0,0 @@
<?php
namespace Pterodactyl\Http\Requests\Api\Application\Nests\Eggs;
use Pterodactyl\Services\Acl\Api\AdminAcl;
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
class GetEggsRequest extends ApplicationApiRequest
{
/**
* @var string
*/
protected $resource = AdminAcl::RESOURCE_EGGS;
/**
* @var int
*/
protected $permission = AdminAcl::READ;
}

View file

@ -7,7 +7,7 @@ use Pterodactyl\Models\Nest;
class GetNestRequest extends GetNestsRequest
{
/**
* Determine if the requested role exists on the Panel.
* Determine if the requested nest exists on the Panel.
*
* @return bool
*/

View file

@ -4,7 +4,7 @@ namespace Pterodactyl\Http\Requests\Api\Application\Nests;
use Pterodactyl\Models\Nest;
class UpdateNestRequest extends StoreNestRequest
class UpdateNestRequest extends StoreEggRequest
{
/**
* ?