Fixes #3771 - adds username to API response on Asset API

This commit is contained in:
snipe 2017-07-25 22:11:50 -07:00
parent ac29b142dc
commit 59006964d1

View file

@ -64,6 +64,7 @@ class AssetsTransformer
'image' => ($asset->getImageUrl()) ? $asset->getImageUrl() : null,
'assigned_to' => ($asset->assigneduser) ? [
'id' => (int) $asset->assigneduser->id,
'username' => e($asset->assigneduser->username),
'name' => e($asset->assigneduser->getFullNameAttribute()),
'first_name'=> e($asset->assigneduser->first_name),
'last_name'=> e($asset->assigneduser->last_name),