Added tests

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2025-09-09 13:51:56 +01:00
parent 57af507170
commit 2eb727bd0c
8 changed files with 286 additions and 28 deletions
+12 -1
View File
@@ -189,7 +189,18 @@ class LocationsController extends Controller
{
$this->authorize('delete', Location::class);
if (is_null($location = Location::find($locationId))) {
$location = Location::withCount('assignedAssets as assigned_assets_count')
->withCount('assets as assets_count')
->withCount('assignedAccessories as assigned_accessories_count')
->withCount('accessories as accessories_count')
->withCount('rtd_assets as rtd_assets_count')
->withCount('children as children_count')
->withCount('users as users_count')
->withCount('consumables as consumables_count')
->withCount('components as components_count')
->find($locationId);
if (!$location) {
return redirect()->to(route('locations.index'))->with('error', trans('admin/locations/message.does_not_exist'));
}