3
0
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:
Marcus Moore
2025-09-09 11:58:43 -07:00
parent f221f9f22a
commit eada0b0bb5
2 changed files with 26 additions and 5 deletions

View File

@ -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);
}