Always allow specifying a page size with the API; closes #3218
This commit is contained in:
parent
9b46d59045
commit
48ad8f538e
8 changed files with 10 additions and 9 deletions
|
@ -83,7 +83,7 @@ class FindViableNodesService
|
|||
*
|
||||
* @throws \Pterodactyl\Exceptions\Service\Deployment\NoViableNodeException
|
||||
*/
|
||||
public function handle(int $page = null)
|
||||
public function handle(int $perPage = null, int $page = null)
|
||||
{
|
||||
Assert::integer($this->disk, 'Disk space must be an int, got %s');
|
||||
Assert::integer($this->memory, 'Memory usage must be an int, got %s');
|
||||
|
@ -103,7 +103,7 @@ class FindViableNodesService
|
|||
->havingRaw('(IFNULL(SUM(servers.disk), 0) + ?) <= (nodes.disk * (1 + (nodes.disk_overallocate / 100)))', [$this->disk]);
|
||||
|
||||
if (!is_null($page)) {
|
||||
$results = $results->paginate(50, ['*'], 'page', $page);
|
||||
$results = $results->paginate($perPage ?? 50, ['*'], 'page', $page);
|
||||
} else {
|
||||
$results = $results->get()->toBase();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue