From 380d48c43a17f1a506a40e58e3a3e11e26f12e8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 19 Nov 2025 15:19:25 +0000 Subject: [PATCH] Hide inactive user groups in API responses --- .changes/unreleased/Fixed-20251119-161233.yaml | 7 +++++++ .../Controller/UserGroupApiController.php | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixed-20251119-161233.yaml diff --git a/.changes/unreleased/Fixed-20251119-161233.yaml b/.changes/unreleased/Fixed-20251119-161233.yaml new file mode 100644 index 000000000..186f95d67 --- /dev/null +++ b/.changes/unreleased/Fixed-20251119-161233.yaml @@ -0,0 +1,7 @@ +kind: Fixed +body: | + Hide the display of inactive user groups in the api +time: 2025-11-19T16:12:33.803084517+01:00 +custom: + Issue: "471" + SchemaChange: No schema change diff --git a/src/Bundle/ChillMainBundle/Controller/UserGroupApiController.php b/src/Bundle/ChillMainBundle/Controller/UserGroupApiController.php index 602b84ec5..0395812b3 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserGroupApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserGroupApiController.php @@ -12,5 +12,12 @@ declare(strict_types=1); namespace Chill\MainBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; +use Symfony\Component\HttpFoundation\Request; -class UserGroupApiController extends ApiController {} +class UserGroupApiController extends ApiController +{ + protected function customizeQuery(string $action, Request $request, $query): void + { + $query->andWhere('e.active = TRUE'); + } +}