mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-05 02:15:41 +00:00
Implement test
This commit is contained in:
@ -1298,11 +1298,12 @@ class AssetsController extends Controller
|
||||
'assigned_type' => Asset::class,
|
||||
]);
|
||||
|
||||
// @todo: offset
|
||||
// @todo: limit
|
||||
|
||||
$total = $query->count();
|
||||
$assets = $query->get();
|
||||
|
||||
$offset = ($request->input('offset') > $total) ? $total : app('api_offset_value');
|
||||
$limit = app('api_limit_value');
|
||||
|
||||
$assets = $query->skip($offset)->take($limit)->get();
|
||||
|
||||
return (new AssetsTransformer)->transformAssets($assets, $total);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user