A free open source IT asset/license management system
$id to $asset->id (thanks tests)
spencerrlongg1139ed676a8d
diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.phpindex 948b291ca4..8361971d5d 100644--- a/app/Http/Controllers/Api/AssetsController.php+++ b/app/Http/Controllers/Api/AssetsController.php@@ -712,7 +712,7 @@ class AssetsController extends Controller} elseif (($request->filled('assigned_asset')) && ($target = Asset::find($request->get('assigned_asset')))) {$location = $target->location_id;- Asset::where('assigned_type', \App\Models\Asset::class)->where('assigned_to', $id)+ Asset::where('assigned_type', \App\Models\Asset::class)->where('assigned_to', $asset->id)->update(['location_id' => $target->location_id]);} elseif (($request->filled('assigned_location')) && ($target = Location::find($request->get('assigned_location')))) {$location = $target->id;