Skip to content

Commit

Permalink
PS-656 backport to v2 search publication (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
aynsix authored Jun 12, 2024
1 parent f04b690 commit 64f79e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions expose/api/src/Entity/Publication.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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={
Expand Down
3 changes: 3 additions & 0 deletions expose/api/src/Entity/PublicationProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -18,6 +20,7 @@

/**
* @ORM\Entity()
* @ApiFilter(SearchFilter::class, properties={"name": "ipartial"})
* @ApiResource(
* normalizationContext=PublicationProfile::API_READ,
* itemOperations={
Expand Down

0 comments on commit 64f79e2

Please sign in to comment.