Allow to find servers by short UUID (Application API) (#3340)

This commit is contained in:
Mark Ross 2021-06-05 12:43:57 -03:00 committed by GitHub
parent e33b1792b1
commit d45c67a6e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,7 +54,7 @@ class ServerController extends ApplicationApiController
public function index(GetServersRequest $request): array public function index(GetServersRequest $request): array
{ {
$servers = QueryBuilder::for(Server::query()) $servers = QueryBuilder::for(Server::query())
->allowedFilters(['uuid', 'name', 'image', 'external_id']) ->allowedFilters(['uuid', 'uuidShort', 'name', 'image', 'external_id'])
->allowedSorts(['id', 'uuid']) ->allowedSorts(['id', 'uuid'])
->paginate($request->query('per_page') ?? 50); ->paginate($request->query('per_page') ?? 50);