diff --git a/src/DataProvider/OrganizationCollectionDataProvider.php b/src/DataProvider/OrganizationCollectionDataProvider.php index 9a300e308bef39a0783d693b1a1fe2ae4ba29ed9..38fd89c6b1122daec7537f0bd8090696177d78d7 100644 --- a/src/DataProvider/OrganizationCollectionDataProvider.php +++ b/src/DataProvider/OrganizationCollectionDataProvider.php @@ -47,10 +47,11 @@ final class OrganizationCollectionDataProvider extends AbstractController implem $options = ['lang' => $filters['lang'] ?? 'de']; $options[LocalData::INCLUDE_PARAMETER_NAME] = LocalData::getIncludeParameter($filters); - Pagination::addPaginationOptions($options, $filters, self::MAX_ITEMS_PER_PAGE); + if ($search = ($filters['search'] ?? null)) { + $options['search'] = $search; + } - dump($filters); - dump($options); + Pagination::addPaginationOptions($options, $filters, self::MAX_ITEMS_PER_PAGE); $personId = $filters['person'] ?? ''; if ($personId !== '') { diff --git a/src/Entity/Organization.php b/src/Entity/Organization.php index 0be5eba90f0a23b96d2ccc312282ad6a36d12843..f55a31dce0474dfb007b1ab95c0af1a6a3dad424 100644 --- a/src/Entity/Organization.php +++ b/src/Entity/Organization.php @@ -18,7 +18,8 @@ use Dbp\Relay\CoreBundle\LocalData\LocalDataAwareTrait; * "openapi_context" = { * "tags" = {"BaseOrganization"}, * "parameters" = { - * {"name" = "person", "in" = "query", "description" = "Get organizations of a person (ID of BasePerson resource)", "required" = false, "type" = "string", "example" = "woody007"}, + * {"name" = "search", "in" = "query", "description" = "Search for an organization", "type" = "string", "required" = false}, + * {"name" = "person", "in" = "query", "description" = "Get organizations of a person (ID of BasePerson resource)", "type" = "string", "required" = false}, * {"name" = "lang", "in" = "query", "description" = "Language of result", "type" = "string", "enum" = {"de", "en"}, "example" = "de"}, * {"name" = "includeLocal", "in" = "query", "description" = "Local data attributes to include", "type" = "string", "example" = "BaseOrganization.code"}, * {"name" = "partialPagination", "in" = "query", "description" = "Enable partial pagination", "type" = "bool", "example" = "false"}