Skip to content

Commit

Permalink
Fix return route after update
Browse files Browse the repository at this point in the history
  • Loading branch information
catdesu committed Mar 13, 2024
1 parent a6ddb1d commit 76c006d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions orif/timbreuse/Config/Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
$routes->get('personal/create', '\Timbreuse\Controllers\PersonalEventPlannings::createPersonal');
$routes->post('personal/create', '\Timbreuse\Controllers\PersonalEventPlannings::createPersonal');
$routes->get('personal/create/(:num)', '\Timbreuse\Controllers\PersonalEventPlannings::createPersonal/$1');
$routes->get('personal/update/(:num)', '\Timbreuse\Controllers\PersonalEventPlannings::updatePersonal/$1');
$routes->post('personal/update/(:num)', '\Timbreuse\Controllers\PersonalEventPlannings::updatePersonal/$1');
$routes->get('personal/update/(:num)/(:num)', '\Timbreuse\Controllers\PersonalEventPlannings::updatePersonal/$1/$2');

$routes->get('delete/(:num)', '\Timbreuse\Controllers\PersonalEventPlannings::delete/$1');
$routes->post('delete/(:num)/(:num)', '\Timbreuse\Controllers\PersonalEventPlannings::delete/$1/$2');
Expand Down
5 changes: 3 additions & 2 deletions orif/timbreuse/Controllers/PersonalEventPlannings.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@ public function updatePersonal(int $id, ?int $userId = 0) : string|RedirectRespo

$userId = $userId !== 0 ?: $eventPlanning['fk_user_sync_id'];

$route = $this->getRoute($isAdminView);


$user = $this->userSyncModel->find($userId);

$route = $this->getRoute($isAdminView, $user['id_user'] ?? null);

$data = [
'formAction' => $this->getFormAction($isAdminView, "event-plannings/personal/update/{$id}"),
Expand Down

0 comments on commit 76c006d

Please sign in to comment.