work on syncing with remote calendar

This commit is contained in:
Julie Lenaerts 2025-01-15 11:22:38 +01:00
parent ed99d8d60b
commit f1221286f3
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\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;

View File

@ -58,7 +58,16 @@ class CalendarEntityListener
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(
new CalendarMessage(
$calendar,

View File

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