WIP dynamic picking of accompanying period work

This commit is contained in:
2025-02-19 15:55:24 +01:00
parent 018aafc773
commit 4d0c3e683f
3 changed files with 34 additions and 7 deletions

View File

@@ -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);