user assets get updated when a user changes location

This commit is contained in:
Godfrey M 2024-03-21 15:15:40 -07:00
parent c4b7e77498
commit 633249b08a
2 changed files with 2 additions and 2 deletions

View file

@ -62,7 +62,7 @@ class AssetCheckoutController extends Controller
$this->authorize('checkout', $asset);
$admin = Auth::user();
$target = $this->determineCheckoutTarget($asset);
$target = $this->determineCheckoutTarget();
$asset = $this->updateAssetLocation($asset, $target);

View file

@ -280,7 +280,7 @@ class UsersController extends Controller
// Update the location of any assets checked out to this user
Asset::where('assigned_type', User::class)
->where('assigned_to', $user->id)
->update(['location_id' => $request->input('location_id', null)]);
->update(['location_id' => $user->location_id]);
// Do we want to update the user password?
if ($request->filled('password')) {