mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: update API endpoints
This commit is contained in:
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user