From e347f88fd76b03d58281d442e84b7722ad42a642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Wed, 24 Jul 2024 20:00:26 +0200 Subject: [PATCH] feat(api): add tld filters --- src/Entity/Domain.php | 1 - src/Entity/Nameserver.php | 1 - src/Entity/Tld.php | 4 ++++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Entity/Domain.php b/src/Entity/Domain.php index 262bd85..135dce3 100644 --- a/src/Entity/Domain.php +++ b/src/Entity/Domain.php @@ -4,7 +4,6 @@ namespace App\Entity; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Get; -use ApiPlatform\Metadata\GetCollection; use App\Controller\DomainRefreshController; use App\Repository\DomainRepository; use DateTimeImmutable; diff --git a/src/Entity/Nameserver.php b/src/Entity/Nameserver.php index 67ad421..71d4224 100644 --- a/src/Entity/Nameserver.php +++ b/src/Entity/Nameserver.php @@ -28,7 +28,6 @@ use Symfony\Component\Serializer\Attribute\SerializedName; normalizationContext: [ 'groups' => [ 'nameserver:item', - 'domain:list', 'nameserver-entity:entity', 'entity:list', "event:list" diff --git a/src/Entity/Tld.php b/src/Entity/Tld.php index 9b0f64c..06fd257 100644 --- a/src/Entity/Tld.php +++ b/src/Entity/Tld.php @@ -2,6 +2,8 @@ namespace App\Entity; +use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; +use ApiPlatform\Metadata\ApiFilter; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; @@ -27,6 +29,7 @@ use Symfony\Component\Serializer\Attribute\Groups; ) ] )] +#[ApiFilter(SearchFilter::class)] #[ORM\Entity(repositoryClass: TldRepository::class)] class Tld { @@ -65,6 +68,7 @@ class Tld private ?bool $specification13 = null; #[ORM\Column(length: 10, nullable: true, enumType: TldType::class)] + #[Groups(["tld:item"])] private ?TldType $type = null; public function __construct()