feat: update API endpoints

This commit is contained in:
Maël Gangloff
2024-07-17 14:00:46 +02:00
parent 36a76f2876
commit c9b9cdad59
6 changed files with 25 additions and 56 deletions

View File

@@ -2,8 +2,6 @@
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\Repository\NameserverRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
@@ -11,20 +9,6 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Groups;
#[ORM\Entity(repositoryClass: NameserverRepository::class)]
#[ApiResource(
operations: [
new Get(
uriTemplate: '/nameservers/{ldhName}',
normalizationContext: [
'groups' => [
'nameserver:item',
'entity:list',
'nameserver-entity:entity'
]
]
)
]
)]
class Nameserver
{
@@ -37,7 +21,6 @@ class Nameserver
* @var Collection<int, NameserverEntity>
*/
#[ORM\OneToMany(targetEntity: NameserverEntity::class, mappedBy: 'nameserver', cascade: ['persist'], orphanRemoval: true)]
#[Groups(['nameserver:item'])]
private Collection $nameserverEntities;
/**