mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Fixes ternary that sets the offset in 0 when the offset passed to the API for the user is greater than total locations. (#9210)
This commit is contained in:
parent
2e298893b6
commit
ab7dd90602
|
@ -54,7 +54,7 @@ class LocationsController extends Controller
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$offset = (($locations) && (request('offset') > $locations->count())) ? 0 : request('offset', 0);
|
$offset = (($locations) && (request('offset') > $locations->count())) ? $locations->count() : request('offset', 0);
|
||||||
|
|
||||||
// Check to make sure the limit is not higher than the max allowed
|
// Check to make sure the limit is not higher than the max allowed
|
||||||
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
|
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
|
||||||
|
|
Loading…
Reference in a new issue