From b67d565c997c027886257223c53801c822ab9d71 Mon Sep 17 00:00:00 2001 From: Dimitri Gritsajuk Date: Tue, 21 May 2024 18:16:19 +0200 Subject: [PATCH] [Event] allow get cancelled events --- src/Api/Doctrine/EventExtension.php | 3 ++- src/Entity/Event/BaseEvent.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Api/Doctrine/EventExtension.php b/src/Api/Doctrine/EventExtension.php index 57af1adda3e..8b99e48c19e 100644 --- a/src/Api/Doctrine/EventExtension.php +++ b/src/Api/Doctrine/EventExtension.php @@ -51,8 +51,9 @@ public function applyToCollection( if (!is_a($resourceClass, BaseEvent::class, true)) { return; } + $filters = $context['filters'] ?? []; - $this->modifyQuery($queryBuilder, $context, BaseEvent::STATUS_SCHEDULED); + $this->modifyQuery($queryBuilder, $context, $filters['status'] ?? BaseEvent::STATUS_SCHEDULED); $alias = $queryBuilder->getRootAliases()[0]; diff --git a/src/Entity/Event/BaseEvent.php b/src/Entity/Event/BaseEvent.php index a35ab19e67a..b929ca1c8fc 100644 --- a/src/Entity/Event/BaseEvent.php +++ b/src/Entity/Event/BaseEvent.php @@ -189,6 +189,7 @@ * "name": "partial", * "mode": "exact", * "beginAt": "start", + * "status": "exact", * }) * @ApiFilter(OrderFilter::class, properties={"createdAt", "beginAt", "finishAt"}) *