diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php index 0d337416b..b5af48674 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php @@ -48,28 +48,6 @@ class ActivityReasonCategoryController extends AbstractController ]); } - /** - * Displays a form to edit an existing ActivityReasonCategory entity. - */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/edit', name: 'chill_activity_activityreasoncategory_edit')] - public function editAction(mixed $id) - { - $em = $this->managerRegistry->getManager(); - - $entity = $em->getRepository(ActivityReasonCategory::class)->find($id); - - if (!$entity) { - throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); - } - - $editForm = $this->createEditForm($entity); - - return $this->render('@ChillActivity/ActivityReasonCategory/edit.html.twig', [ - 'entity' => $entity, - 'edit_form' => $editForm->createView(), - ]); - } - /** * Lists all ActivityReasonCategory entities. */ @@ -122,7 +100,7 @@ class ActivityReasonCategoryController extends AbstractController /** * Edits an existing ActivityReasonCategory entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/update', name: 'chill_activity_activityreasoncategory_update', methods: ['POST', 'PUT'])] + #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/update', name: 'chill_activity_activityreasoncategory_update')] public function updateAction(Request $request, mixed $id) { $em = $this->managerRegistry->getManager(); @@ -139,7 +117,7 @@ class ActivityReasonCategoryController extends AbstractController if ($editForm->isSubmitted() && $editForm->isValid()) { $em->flush(); - return $this->redirectToRoute('chill_activity_activityreasoncategory_edit', ['id' => $id]); + return $this->redirectToRoute('chill_activity_activityreasoncategory', ['id' => $id]); } return $this->render('@ChillActivity/ActivityReasonCategory/edit.html.twig', [ @@ -178,7 +156,7 @@ class ActivityReasonCategoryController extends AbstractController { $form = $this->createForm(ActivityReasonCategoryType::class, $entity, [ 'action' => $this->generateUrl('chill_activity_activityreasoncategory_update', ['id' => $entity->getId()]), - 'method' => 'PUT', + 'method' => 'POST', ]); $form->add('submit', SubmitType::class, ['label' => 'Update']); diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php index 37d04d367..77dd6c9d4 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php @@ -50,28 +50,6 @@ class ActivityReasonController extends AbstractController ]); } - /** - * Displays a form to edit an existing ActivityReason entity. - */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/edit', name: 'chill_activity_activityreason_edit')] - public function editAction(mixed $id) - { - $em = $this->managerRegistry->getManager(); - - $entity = $em->getRepository(ActivityReason::class)->find($id); - - if (null === $entity) { - throw new NotFoundHttpException('Unable to find ActivityReason entity.'); - } - - $editForm = $this->createEditForm($entity); - - return $this->render('@ChillActivity/ActivityReason/edit.html.twig', [ - 'entity' => $entity, - 'edit_form' => $editForm->createView(), - ]); - } - /** * Lists all ActivityReason entities. */ @@ -180,7 +158,7 @@ class ActivityReasonController extends AbstractController { $form = $this->createForm(ActivityReasonType::class, $entity, [ 'action' => $this->generateUrl('chill_activity_activityreason_update', ['id' => $entity->getId()]), - 'method' => 'PUT', + 'method' => 'POST', ]); $form->add('submit', SubmitType::class, ['label' => 'Update']); diff --git a/src/Bundle/ChillActivityBundle/Resources/views/ActivityReasonCategory/index.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReasonCategory/index.html.twig index 5f48180b3..e56c874b1 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/ActivityReasonCategory/index.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/ActivityReasonCategory/index.html.twig @@ -26,7 +26,7 @@