From d4880e7b56d67e9be1048a877b5427c76994ad3c Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 28 Aug 2024 16:13:32 +0200 Subject: [PATCH] fix: [users] add load individual correctly and show it to the user --- src/Controller/UsersController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Controller/UsersController.php b/src/Controller/UsersController.php index 7be3d69..438b3bf 100644 --- a/src/Controller/UsersController.php +++ b/src/Controller/UsersController.php @@ -156,6 +156,10 @@ class UsersController extends AppController if (Configure::read('keycloak.enabled')) { $this->Users->enrollUserRouter($data); } + if ($data['individual_id']) { + $data['individual'] = $this->Users->Individuals->find('all')->where(['id' => $data['individual_id']])->contain(['Alignments' => 'Organisations'])->first(); + } + return $data; }, 'afterFind' => function ($user, &$params) use ($currentUser) { if (!empty($user)) { // We don't have a 404