From ab7dd90602ad175aa4e28ba476da6f8bce187407 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Fri, 26 Feb 2021 14:56:04 -0600 Subject: [PATCH] Fixes ternary that sets the offset in 0 when the offset passed to the API for the user is greater than total locations. (#9210) --- app/Http/Controllers/Api/LocationsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/LocationsController.php b/app/Http/Controllers/Api/LocationsController.php index c6fef9304..ed7168515 100644 --- a/app/Http/Controllers/Api/LocationsController.php +++ b/app/Http/Controllers/Api/LocationsController.php @@ -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');