mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Include correct license, asset, etc count on user show API call
This commit is contained in:
parent
779fc6d195
commit
324da7c0c8
|
@ -229,7 +229,7 @@ class UsersController extends Controller
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
$this->authorize('view', User::class);
|
$this->authorize('view', User::class);
|
||||||
$user = User::findOrFail($id);
|
$user = User::withCount('assets as assets_count','licenses as licenses_count','accessories as accessories_count','consumables as consumables_count')->findOrFail($id);
|
||||||
return (new UsersTransformer)->transformUser($user);
|
return (new UsersTransformer)->transformUser($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue