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:
Ivan Nieto Vivanco 2021-02-26 14:56:04 -06:00 committed by GitHub
parent 2e298893b6
commit ab7dd90602
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');