work on syncing with remote calendar

This commit is contained in:
Julie Lenaerts 2025-01-15 11:22:38 +01:00
parent 129690ca3f
commit 309cc64275
3 changed files with 12 additions and 2 deletions

View File

@ -37,7 +37,6 @@ use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Form; use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -58,7 +58,16 @@ class CalendarEntityListener
public function postUpdate(Calendar $calendar, PostUpdateEventArgs $args): void public function postUpdate(Calendar $calendar, PostUpdateEventArgs $args): void
{ {
if (!$calendar->preventEnqueueChanges) { if ($calendar->getStatus() === $calendar::STATUS_CANCELED) {
$this->messageBus->dispatch(
new CalendarRemovedMessage(
$calendar,
$this->security->getUser()
)
);
}
if (!$calendar->preventEnqueueChanges && !$calendar->getStatus() === $calendar::STATUS_CANCELED) {
$this->messageBus->dispatch( $this->messageBus->dispatch(
new CalendarMessage( new CalendarMessage(
$calendar, $calendar,

View File

@ -70,6 +70,8 @@ class CalendarRemovedMessage
public function getRemoteId(): string public function getRemoteId(): string
{ {
dump($this->remoteId);
return $this->remoteId; return $this->remoteId;
} }
} }