allow filtering servers by description; closes #4150

This commit is contained in:
DaneEveritt 2022-06-26 13:26:12 -04:00
parent b3a57bd0ad
commit ca39830333
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 2 additions and 1 deletions

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', 'uuidShort', 'name', 'image', 'external_id']) ->allowedFilters(['uuid', 'uuidShort', 'name', 'description', 'image', 'external_id'])
->allowedSorts(['id', 'uuid']) ->allowedSorts(['id', 'uuid'])
->paginate($request->query('per_page') ?? 50); ->paginate($request->query('per_page') ?? 50);

View file

@ -43,6 +43,7 @@ class ClientController extends ClientApiController
)->allowedFilters([ )->allowedFilters([
'uuid', 'uuid',
'name', 'name',
'description',
'external_id', 'external_id',
AllowedFilter::custom('*', new MultiFieldServerFilter()), AllowedFilter::custom('*', new MultiFieldServerFilter()),
]); ]);