From e297a6e1a20ec58be9761de1d9a7eb8acdf200cb Mon Sep 17 00:00:00 2001
From: Moreau Elise <moreau.elise13@gmail.com>
Date: Sun, 25 Oct 2020 18:15:22 +0100
Subject: [PATCH] add query to return list users in json

---
 src/Application/Actions/Search/ListUsersJson.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Application/Actions/Search/ListUsersJson.php b/src/Application/Actions/Search/ListUsersJson.php
index 019f1cd..dd491f6 100644
--- a/src/Application/Actions/Search/ListUsersJson.php
+++ b/src/Application/Actions/Search/ListUsersJson.php
@@ -30,7 +30,8 @@ class ListUsersJson extends Action
 
         $parsedRequestBody = (array)$this->request->getParsedBody();
 
-        $search =  $this->request->getQueryParams()['q'];
+        $queryParams = $this->request->getQueryParams();
+        $search = isset($queryParams['q']) ? $queryParams['q'] : '';
         
         $users_query = $this->userRepository->createQueryBuilder('u');
         $users_list = $users_query
-- 
GitLab