feat: remove lastChanged event

This commit is contained in:
Maël Gangloff 2024-07-15 11:52:51 +02:00
parent aa54d4c9ce
commit 16610205b6
No known key found for this signature in database
GPG Key ID: 11FDC81C24A7F629
2 changed files with 5 additions and 3 deletions

View File

@ -19,6 +19,7 @@ use Eluceo\iCal\Presentation\Factory\CalendarFactory;
use Exception; use Exception;
use Sabre\VObject\Reader; use Sabre\VObject\Reader;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Routing\Attribute\Route;
@ -34,11 +35,11 @@ class TestController extends AbstractController
} }
#[Route(path: '/test/register/{fqdn}', name: 'test_register_domain')] #[Route(path: '/test/register', name: 'test_register_domain')]
public function testRegisterDomain(string $fqdn): Response public function testRegisterDomain(Request $request): Response
{ {
try { try {
$this->RDAPService->registerDomains([$fqdn]); $this->RDAPService->registerDomains(explode(',', $request->query->get('domains')));
} catch (Exception $e) { } catch (Exception $e) {
return new Response($e->getMessage(), Response::HTTP_INTERNAL_SERVER_ERROR); return new Response($e->getMessage(), Response::HTTP_INTERNAL_SERVER_ERROR);
} }

View File

@ -224,6 +224,7 @@ readonly class RDAPService
if (!array_key_exists('events', $rdapEntity)) return $entity; if (!array_key_exists('events', $rdapEntity)) return $entity;
foreach ($rdapEntity['events'] as $rdapEntityEvent) { foreach ($rdapEntity['events'] as $rdapEntityEvent) {
if ($rdapEntityEvent["eventAction"] === EventAction::LastChanged->value) continue;
$event = $this->entityEventRepository->findOneBy([ $event = $this->entityEventRepository->findOneBy([
"action" => EventAction::from($rdapEntityEvent["eventAction"]), "action" => EventAction::from($rdapEntityEvent["eventAction"]),
"date" => new DateTimeImmutable($rdapEntityEvent["eventDate"]) "date" => new DateTimeImmutable($rdapEntityEvent["eventDate"])