diff --git a/app/Http/Controllers/Api/ConsumablesController.php b/app/Http/Controllers/Api/ConsumablesController.php index 7bddde070c..35fb08470a 100644 --- a/app/Http/Controllers/Api/ConsumablesController.php +++ b/app/Http/Controllers/Api/ConsumablesController.php @@ -228,11 +228,16 @@ class ConsumablesController extends Controller foreach ($consumable->consumableAssignments as $consumable_assignment) { $rows[] = [ 'avatar' => ($consumable_assignment->user) ? e($consumable_assignment->user->present()->gravatar) : '', - 'name' => ($consumable_assignment->user) ? $consumable_assignment->user->present()->nameUrl() : 'Deleted User', + 'user' => ($consumable_assignment->user) ? [ + 'id' => (int) $consumable_assignment->user->id, + 'name'=> e($consumable_assignment->user->present()->fullName()), + ] : null, 'created_at' => Helper::getFormattedDateObject($consumable_assignment->created_at, 'datetime'), 'note' => ($consumable_assignment->note) ? e($consumable_assignment->note) : null, - 'admin' => ($consumable_assignment->adminuser) ? $consumable_assignment->adminuser->present()->nameUrl() : null, // legacy, so we don't change the shape of the response - 'created_by' => ($consumable_assignment->adminuser) ? $consumable_assignment->adminuser->present()->nameUrl() : null, + 'created_by' => ($consumable_assignment->adminuser) ? [ + 'id' => (int) $consumable_assignment->adminuser->id, + 'name'=> e($consumable_assignment->adminuser->present()->fullName()), + ] : null, ]; } diff --git a/resources/views/consumables/view.blade.php b/resources/views/consumables/view.blade.php index 56d2e2ddba..f468eedfd7 100644 --- a/resources/views/consumables/view.blade.php +++ b/resources/views/consumables/view.blade.php @@ -423,12 +423,12 @@ {{ trans('general.image') }} - {{ trans('general.user') }} + {{ trans('general.user') }} {{ trans('general.date') }} {{ trans('general.notes') }} - {{ trans('general.created_by') }} + {{ trans('general.created_by') }}