mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Fix delete request for all entities
This commit is contained in:
@@ -80,10 +80,10 @@ final class AccompanyingCourseWorkController extends AbstractController
|
||||
|
||||
$form = $this->createDeleteForm($work->getId());
|
||||
|
||||
if (Request::METHOD_DELETE === $request->getMethod()) {
|
||||
if (Request::METHOD_POST === $request->getMethod()) {
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->chillLogger->notice('An accompanying period work has been removed', [
|
||||
'by_user' => $this->getUser()->getUsername(),
|
||||
'work_id' => $work->getId(),
|
||||
@@ -179,7 +179,6 @@ final class AccompanyingCourseWorkController extends AbstractController
|
||||
|
||||
return $this->createFormBuilder()
|
||||
->setAction($this->generateUrl('chill_person_accompanying_period_work_delete', $params))
|
||||
->setMethod('DELETE')
|
||||
->add('submit', SubmitType::class, ['label' => 'Delete'])
|
||||
->getForm();
|
||||
}
|
||||
|
@@ -63,11 +63,10 @@ class HouseholdCompositionController extends AbstractController
|
||||
'composition_id' => $composition_id,
|
||||
'household_id' => $household_id,
|
||||
]))
|
||||
->setMethod('DELETE')
|
||||
->add('submit', SubmitType::class, ['label' => 'Delete'])
|
||||
->getForm();
|
||||
|
||||
if (Request::METHOD_DELETE === $request->getMethod()) {
|
||||
if (Request::METHOD_POST === $request->getMethod()) {
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
|
@@ -44,14 +44,13 @@ final class PersonResourceController extends AbstractController
|
||||
'resource_id' => $resource_id,
|
||||
'person_id' => $person_id,
|
||||
]))
|
||||
->setMethod('DELETE')
|
||||
->add('submit', SubmitType::class, ['label' => 'Delete'])
|
||||
->getForm();
|
||||
|
||||
if (Request::METHOD_DELETE === $request->getMethod()) {
|
||||
if (Request::METHOD_POST === $request->getMethod()) {
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->em->remove($resource);
|
||||
$this->em->flush();
|
||||
|
||||
|
Reference in New Issue
Block a user