Merge pull request #16269 from snipe/bug/sc-28437_fix

Scope API results by location ID
This commit is contained in:
snipe 2025-02-18 19:05:29 +00:00 committed by GitHub
commit 029450bcbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -258,7 +258,7 @@ class LocationsController extends Controller
{
$this->authorize('view', Accessory::class);
$this->authorize('view', $location);
$accessory_checkouts = AccessoryCheckout::LocationAssigned()->with('adminuser')->with('accessories');
$accessory_checkouts = AccessoryCheckout::LocationAssigned()->where('assigned_to', $location->id)->with('adminuser')->with('accessories');
$offset = ($request->input('offset') > $accessory_checkouts->count()) ? $accessory_checkouts->count() : app('api_offset_value');
$limit = app('api_limit_value');