mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 05:44:58 +00:00
WIP dynamic picking of accompanying period work
This commit is contained in:
@@ -23,9 +23,10 @@ class AccompanyingPeriodWorkDuplicateController extends AbstractController
|
||||
public function __construct(private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository, private readonly TranslatorInterface $translator) {}
|
||||
|
||||
#[Route(path: '{_locale}/person/accompanying-period/work/{id}/assign-duplicate', name: 'chill_person_accompanying_period_work_assign_duplicate', methods: ['GET'])]
|
||||
public function assignDuplicate(mixed $id, Request $request)
|
||||
public function assignDuplicate(int $id, Request $request)
|
||||
{
|
||||
$acpw1= $this->accompanyingPeriodWorkRepository->find($id);
|
||||
$accompanyingPeriod = $acpw1->getAccompanyingPeriod();
|
||||
|
||||
if (null === $acpw1) {
|
||||
throw $this->createNotFoundException("Accompanying period work with id {$id} not".' found on this server');
|
||||
@@ -37,7 +38,7 @@ class AccompanyingPeriodWorkDuplicateController extends AbstractController
|
||||
'You are not allowed to merge this accompanying period work'
|
||||
);
|
||||
|
||||
$form = $this->createForm(FindAccompanyingPeriodWorkType::class);
|
||||
$form = $this->createForm(FindAccompanyingPeriodWorkType::class, null, ['accompanyingPeriod' => $accompanyingPeriod]);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
|
Reference in New Issue
Block a user