mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-23 12:44:12 -08:00
Use the transformers, Luke
This commit is contained in:
parent
99be54fd96
commit
7140efc561
|
@ -10,6 +10,7 @@ use App\Models\User;
|
|||
use App\Helpers\Helper;
|
||||
use App\Http\Requests\SaveUserRequest;
|
||||
use App\Models\Asset;
|
||||
use App\Http\Transformers\AssetsTransformer;
|
||||
|
||||
class UsersController extends Controller
|
||||
{
|
||||
|
@ -209,6 +210,7 @@ class UsersController extends Controller
|
|||
{
|
||||
$this->authorize('view', User::class);
|
||||
$assets = Asset::where('assigned_to', '=', $id)->with('model')->get();
|
||||
return response()->json($assets);
|
||||
return (new AssetsTransformer)->transformAssets($assets, $assets->count());
|
||||
// return response()->json($assets);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue