Skip to content
Snippets Groups Projects
Commit bfba0d04 authored by Moreau Elise's avatar Moreau Elise
Browse files

use $this->userRepository from groupaction

parent 6adcebfd
Branches
No related tags found
No related merge requests found
...@@ -20,8 +20,7 @@ class AddUserGroupAction extends GroupAction ...@@ -20,8 +20,7 @@ class AddUserGroupAction extends GroupAction
if (!isset($group)) { if (!isset($group)) {
throw new GroupNotFoundException(); throw new GroupNotFoundException();
} }
$userRepository = $this->em->getRepository('App\Domain\User\User'); $currentUser = $this->userRepository->find($_SESSION['userId']);
$currentUser = $userRepository->find($_SESSION['userId']);
$currentUser->addGroup($group); $currentUser->addGroup($group);
$this->em->persist($group); $this->em->persist($group);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment