mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
Add search to API endpoints
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user