From bfba0d04310cff4eeca5a1677f86c00e0b162425 Mon Sep 17 00:00:00 2001
From: Moreau Elise <moreau.elise13@gmail.com>
Date: Sun, 11 Oct 2020 15:42:56 +0200
Subject: [PATCH] use $this->userRepository from groupaction
---
src/Application/Actions/Group/AddUserGroupAction.php | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/Application/Actions/Group/AddUserGroupAction.php b/src/Application/Actions/Group/AddUserGroupAction.php
index f09e084..04155ee 100755
--- a/src/Application/Actions/Group/AddUserGroupAction.php
+++ b/src/Application/Actions/Group/AddUserGroupAction.php
@@ -20,8 +20,7 @@ class AddUserGroupAction extends GroupAction
if (!isset($group)) {
throw new GroupNotFoundException();
}
- $userRepository = $this->em->getRepository('App\Domain\User\User');
- $currentUser = $userRepository->find($_SESSION['userId']);
+ $currentUser = $this->userRepository->find($_SESSION['userId']);
$currentUser->addGroup($group);
$this->em->persist($group);
--
GitLab