diff --git a/app/Http/Transformers/UsersTransformer.php b/app/Http/Transformers/UsersTransformer.php index eb791a23a1..e93c6f2b69 100644 --- a/app/Http/Transformers/UsersTransformer.php +++ b/app/Http/Transformers/UsersTransformer.php @@ -32,6 +32,10 @@ class UsersTransformer 'groups' => $user->groups, 'jobtitle' => e($user->jobtitle), 'email' => e($user->email), + 'department' => ($user->department) ? [ + 'id' => (int) $user->department->id, + 'name'=> e($user->department->name) + ] : null, 'location' => (new LocationsTransformer)->transformLocation($user->userloc), 'permissions' => $user->decodePermissions(), 'activated' => ($user->activated =='1') ? true : false,