A free open source IT asset/license management system
Include accessories count
snipe9350a20189a2
diff --git a/app/Http/Controllers/Api/LocationsController.php b/app/Http/Controllers/Api/LocationsController.phpindex 9b07813f76..10744bee27 100644--- a/app/Http/Controllers/Api/LocationsController.php+++ b/app/Http/Controllers/Api/LocationsController.php@@ -248,7 +248,7 @@ class LocationsController extends Controller->withCount('rtd_assets as rtd_assets_count')->withCount('children as children_count')->withCount('users as users_count')- ->withCount('checkouts as accessories_count')+ ->withCount('accessories as accessories_count')->findOrFail($id);if (! $location->isDeletable()) {diff --git a/app/Models/Location.php b/app/Models/Location.phpindex b03fae60d9..f08a51a985 100755--- a/app/Models/Location.php+++ b/app/Models/Location.php@@ -108,11 +108,11 @@ class Location extends SnipeModel{return Gate::allows('delete', $this)- && ($this->assets_count === 0)- && ($this->assigned_assets_count === 0)- && ($this->children_count === 0)- && ($this->accessories_count === 0)- && ($this->users_count === 0);+ && ($this->assets_count == 0)+ && ($this->assigned_assets_count == 0)+ && ($this->children_count == 0)+ && ($this->accessories_count == 0)+ && ($this->users_count == 0);}/**