mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-22 17:12:30 +01:00
Add search to API endpoints
This commit is contained in:
parent
9fd17db103
commit
2e693067b8
@ -8,6 +8,9 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||
* `[rc.2]` — Fixes bad API behavior on `/user` routes.
|
||||
* `[rc.2]` — Fixes Admin CP user editing resetting a password on users unintentionally.
|
||||
|
||||
### Added
|
||||
* Added ability to search the following API endpoints: list users, list servers, and list locations.
|
||||
|
||||
## v0.7.0-rc.2 (Derelict Dermodactylus)
|
||||
### Fixed
|
||||
* `[rc.1]` — Fixes exception thrown when revoking user sessions.
|
||||
|
@ -67,7 +67,7 @@ class LocationController extends ApplicationApiController
|
||||
*/
|
||||
public function index(GetLocationsRequest $request): array
|
||||
{
|
||||
$locations = $this->repository->paginated(100);
|
||||
$locations = $this->repository->setSearchTerm($request->input('search'))->paginated(50);
|
||||
|
||||
return $this->fractal->collection($locations)
|
||||
->transformWith($this->getTransformer(LocationTransformer::class))
|
||||
|
@ -69,7 +69,7 @@ class NodeController extends ApplicationApiController
|
||||
*/
|
||||
public function index(GetNodesRequest $request): array
|
||||
{
|
||||
$nodes = $this->repository->paginated(50);
|
||||
$nodes = $this->repository->setSearchTerm($request->input('search'))->paginated(50);
|
||||
|
||||
return $this->fractal->collection($nodes)
|
||||
->transformWith($this->getTransformer(NodeTransformer::class))
|
||||
|
@ -70,7 +70,7 @@ class UserController extends ApplicationApiController
|
||||
*/
|
||||
public function index(GetUsersRequest $request): array
|
||||
{
|
||||
$users = $this->repository->paginated(100);
|
||||
$users = $this->repository->setSearchTerm($request->input('search'))->paginated(50);
|
||||
|
||||
return $this->fractal->collection($users)
|
||||
->transformWith($this->getTransformer(UserTransformer::class))
|
||||
|
Loading…
Reference in New Issue
Block a user