Check for accessories on bulk items

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-08-07 20:04:32 +01:00
parent 5546ab08c2
commit 889d5da71e
2 changed files with 2 additions and 0 deletions

View file

@ -248,6 +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')
->findOrFail($id);
if (! $location->isDeletable()) {

View file

@ -111,6 +111,7 @@ class Location extends SnipeModel
&& ($this->assets_count === 0)
&& ($this->assigned_assets_count === 0)
&& ($this->children_count === 0)
&& ($this->accessories_count === 0)
&& ($this->users_count === 0);
}