Skip to content

Commit f31dd47

Browse files
committed
Fix location controller searches
1 parent a66623d commit f31dd47

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/Http/Controllers/Api/Application/Locations/LocationController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Http\Response;
66
use Pterodactyl\Models\Location;
77
use Illuminate\Http\JsonResponse;
8+
use Spatie\QueryBuilder\QueryBuilder;
89
use Pterodactyl\Services\Locations\LocationUpdateService;
910
use Pterodactyl\Services\Locations\LocationCreationService;
1011
use Pterodactyl\Services\Locations\LocationDeletionService;
@@ -69,7 +70,10 @@ public function __construct(
6970
*/
7071
public function index(GetLocationsRequest $request): array
7172
{
72-
$locations = $this->repository->setSearchTerm($request->input('search'))->paginated(50);
73+
$locations = QueryBuilder::for(Location::query())
74+
->allowedFilters(['short', 'long'])
75+
->allowedSorts(['id'])
76+
->paginate(100);
7377

7478
return $this->fractal->collection($locations)
7579
->transformWith($this->getTransformer(LocationTransformer::class))

0 commit comments

Comments
 (0)