Merge pull request #13363 from inietov/fixes/no_records_found_multipage_license_seats

Fixed #13298 "No records Found" when Switching between Single and Multi-Page Licenses
This commit is contained in:
snipe 2023-07-26 08:48:44 +01:00 committed by GitHub
commit f6545be410
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,6 +42,11 @@ class LicenseSeatsController extends Controller
// Make sure the offset and limit are actually integers and do not exceed system limits // Make sure the offset and limit are actually integers and do not exceed system limits
$offset = ($request->input('offset') > $seats->count()) ? $seats->count() : abs($request->input('offset')); $offset = ($request->input('offset') > $seats->count()) ? $seats->count() : abs($request->input('offset'));
if ($offset >= $total ){
$offset = 0;
}
$limit = app('api_limit_value'); $limit = app('api_limit_value');
$seats = $seats->skip($offset)->take($limit)->get(); $seats = $seats->skip($offset)->take($limit)->get();