mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
More compact payload for users API on location and manager
This commit is contained in:
parent
847262e989
commit
66d8308163
|
@ -28,15 +28,21 @@ class UsersTransformer
|
|||
'lastname' => e($user->last_name),
|
||||
'username' => e($user->username),
|
||||
'employee_num' => e($user->employee_num),
|
||||
'manager' => ($user->manager) ? (new UsersTransformer)->transformUser($user->manager) : null,
|
||||
'manager' => ($user->manager) ? [
|
||||
'id' => (int) $user->manager->id,
|
||||
'name'=> e($user->manager->name)
|
||||
] : null,
|
||||
'groups' => $user->groups,
|
||||
'jobtitle' => e($user->jobtitle),
|
||||
'jobtitle' => ($user->jobtitle) ? e($user->jobtitle) : null,
|
||||
'email' => e($user->email),
|
||||
'department' => ($user->department) ? [
|
||||
'id' => (int) $user->department->id,
|
||||
'name'=> e($user->department->name)
|
||||
] : null,
|
||||
'location' => (new LocationsTransformer)->transformLocation($user->userloc),
|
||||
'location' => ($user->userloc) ? [
|
||||
'id' => (int) $user->userloc->id,
|
||||
'name'=> e($user->userloc->name)
|
||||
] : null,
|
||||
'permissions' => $user->decodePermissions(),
|
||||
'activated' => ($user->activated =='1') ? true : false,
|
||||
'two_factor_activated' => ($user->activated =='1') ? true : false,
|
||||
|
|
Loading…
Reference in a new issue