diff --git a/expose/api/src/Entity/Publication.php b/expose/api/src/Entity/Publication.php index 8fde44858..e9aad5f97 100644 --- a/expose/api/src/Entity/Publication.php +++ b/expose/api/src/Entity/Publication.php @@ -11,6 +11,7 @@ use ApiPlatform\Core\Annotation\ApiSubresource; use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter; use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter; +use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter; use App\Controller\GetPublicationAction; use App\Controller\GetPublicationSlugAvailabilityAction; use App\Controller\SortAssetsAction; @@ -34,6 +35,7 @@ * @ORM\Entity() * @ApiFilter(OrderFilter::class, properties={"title": "ASC", "createdAt": "DESC", "updatedAt": "DESC"}, arguments={"orderParameterName"="order"}) * @ApiFilter(PublicationFilter::class, properties={"flatten", "parentId", "profileId", "mine", "expired"}) + * @ApiFilter(SearchFilter::class, properties={"title": "ipartial", "description": "ipartial"}) * @ApiFilter(DateFilter::class, properties={"config.beginsAt", "config.expiresAt", "createdAt"}) * @ApiResource( * attributes={ diff --git a/expose/api/src/Entity/PublicationProfile.php b/expose/api/src/Entity/PublicationProfile.php index 3b9327adf..d17ecc34e 100644 --- a/expose/api/src/Entity/PublicationProfile.php +++ b/expose/api/src/Entity/PublicationProfile.php @@ -5,8 +5,10 @@ namespace App\Entity; use Alchemy\AclBundle\AclObjectInterface; +use ApiPlatform\Core\Annotation\ApiFilter; use ApiPlatform\Core\Annotation\ApiProperty; use ApiPlatform\Core\Annotation\ApiResource; +use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter; use App\Entity\Traits\CapabilitiesTrait; use App\Entity\Traits\ClientAnnotationsTrait; use DateTime; @@ -18,6 +20,7 @@ /** * @ORM\Entity() + * @ApiFilter(SearchFilter::class, properties={"name": "ipartial"}) * @ApiResource( * normalizationContext=PublicationProfile::API_READ, * itemOperations={