fix: add missing template variable
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Controller\Administrative\Assignment;
|
||||
|
||||
use App\Controller\Traits\ReturnUrlTrait;
|
||||
use App\Entity\Assignment;
|
||||
use App\Entity\User;
|
||||
use App\Form\AssignmentType;
|
||||
@@ -15,6 +16,8 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class CreateController extends AbstractController
|
||||
{
|
||||
use ReturnUrlTrait;
|
||||
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly LoggerInterface $logger
|
||||
@@ -29,6 +32,7 @@ class CreateController extends AbstractController
|
||||
$user = $this->getUser();
|
||||
$assignment = new Assignment();
|
||||
$assignment->setOwner($user);
|
||||
$returnUrl = $this->getReturnUrl($request, 'app_administrative_assignment_index');
|
||||
|
||||
$form = $this->createForm(
|
||||
AssignmentType::class,
|
||||
@@ -51,11 +55,12 @@ class CreateController extends AbstractController
|
||||
'job_profile' => $assignment->getJobProfile()->getName(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_administrative_assignment_index');
|
||||
return $this->redirectToRoute($returnUrl);
|
||||
}
|
||||
|
||||
return $this->render('administrative/assignment/create.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
'returnUrl' => $returnUrl,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user