From 734ee930f10cda0ad7b9421de4b8b6888e75ab00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Sun, 22 Dec 2024 22:13:27 +0100 Subject: [PATCH] fix: entity name --- assets/utils/functions/entityToName.tsx | 2 +- src/Entity/Domain.php | 2 ++ src/Entity/DomainStatus.php | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/utils/functions/entityToName.tsx b/assets/utils/functions/entityToName.tsx index 9d760bf..d5f8487 100644 --- a/assets/utils/functions/entityToName.tsx +++ b/assets/utils/functions/entityToName.tsx @@ -6,8 +6,8 @@ export const entityToName = (e: { entity: Entity }): string => { const jCard = vCard.fromJSON(e.entity.jCard) let name = e.entity.handle - if (jCard.data.fn && !Array.isArray(jCard.data.fn) && jCard.data.fn.valueOf() !== '') name = jCard.data.fn.valueOf() if (jCard.data.org && !Array.isArray(jCard.data.org) && jCard.data.org.valueOf() !== '') name = jCard.data.org.valueOf() + if (jCard.data.fn && !Array.isArray(jCard.data.fn) && jCard.data.fn.valueOf() !== '') name = jCard.data.fn.valueOf() return name } \ No newline at end of file diff --git a/src/Entity/Domain.php b/src/Entity/Domain.php index d3842ba..6d4c66a 100644 --- a/src/Entity/Domain.php +++ b/src/Entity/Domain.php @@ -110,6 +110,8 @@ class Domain * @var Collection */ #[ORM\OneToMany(targetEntity: DomainStatus::class, mappedBy: 'domain', orphanRemoval: true)] + #[Groups(['domain:item'])] + #[SerializedName('oldStatus')] private Collection $domainStatuses; private const IMPORTANT_EVENTS = [EventAction::Deletion->value, EventAction::Expiration->value]; diff --git a/src/Entity/DomainStatus.php b/src/Entity/DomainStatus.php index b9aa664..b96b9bc 100644 --- a/src/Entity/DomainStatus.php +++ b/src/Entity/DomainStatus.php @@ -5,6 +5,7 @@ namespace App\Entity; use App\Repository\DomainStatusRepository; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Serializer\Attribute\Groups; #[ORM\Entity(repositoryClass: DomainStatusRepository::class)] class DomainStatus @@ -19,12 +20,15 @@ class DomainStatus private ?Domain $domain = null; #[ORM\Column] + #[Groups(['domain:item'])] private ?\DateTimeImmutable $date = null; #[ORM\Column(type: Types::SIMPLE_ARRAY, nullable: true)] + #[Groups(['domain:item'])] private array $addStatus = []; #[ORM\Column(type: Types::SIMPLE_ARRAY, nullable: true)] + #[Groups(['domain:item'])] private array $deleteStatus = []; public function __construct()