Commit e9ab73e6 authored by Moreau Elise's avatar Moreau Elise
Browse files

resolve conflicts in files

parent 1751a270
......@@ -35,7 +35,7 @@ class AddUserGroupAction extends GroupAction
->withHeader('Location', '/groups/' . $groupId)
->withStatus(302);
}
$currentUser->addGroup($group);
$currentUser->addGroup($group);
$this->em->persist($group);
$this->em->flush();
......
......@@ -23,12 +23,12 @@ class CreateGroupAction extends GroupAction
->withHeader('Location', '/login')
->withStatus(302);
}
$currentUser = $this->em->getRepository('App\Domain\User\User')->find($_SESSION['userId']);
$groupname = $parsedRequestBody['name'];
$description = $parsedRequestBody['description'];
$private = isset($parsedRequestBody['private']) ? 1 : 0;
if ($this->groupRepository->findOneBy(array('name' => $groupname))){
return $this->twig->render(
$this->response, "/group/create_group.twig",
......@@ -41,9 +41,9 @@ class CreateGroupAction extends GroupAction
)
);
}
$group = new Group(null, $groupname, $description, $currentUser, $private);
$currentUser->addGroup($group);
$currentUser->addGroup($group);
$this->em->persist($group);
$this->em->flush();
......
......@@ -12,7 +12,7 @@ class ViewModifyGroupForm extends GroupAction
* {@inheritdoc}
*/
protected function action(): Response
{
{
if(!isset($_SESSION['userId'])){
$this->flash->addMessage('login', 'Please log in or sign up.');
......@@ -20,12 +20,12 @@ class ViewModifyGroupForm extends GroupAction
->withHeader('Location', '/login')
->withStatus(302);
}
$parsedRequestBody = (array)$this->request->getParsedBody();
$groupId = (int) $this->resolveArg('id');
$group = $this->groupRepository->find($groupId);
if (!isset($group)) {
throw new GroupNotFoundException();
}
......@@ -35,7 +35,7 @@ class ViewModifyGroupForm extends GroupAction
->withHeader('Location', '/account')
->withStatus(302);
}
return $this->twig->render($this->response, "/group/modify_group.twig", ["group" => $group, "session" => $_SESSION]);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment