fix: [users] add load individual correctly and show it to the user

develop
iglocska 2024-08-28 16:13:32 +02:00
parent 5048c38ed6
commit d4880e7b56
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 4 additions and 0 deletions

View File

@ -156,6 +156,10 @@ class UsersController extends AppController
if (Configure::read('keycloak.enabled')) { if (Configure::read('keycloak.enabled')) {
$this->Users->enrollUserRouter($data); $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) { 'afterFind' => function ($user, &$params) use ($currentUser) {
if (!empty($user)) { // We don't have a 404 if (!empty($user)) { // We don't have a 404