mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
user assets get updated when a user changes location
This commit is contained in:
parent
c4b7e77498
commit
633249b08a
|
@ -62,7 +62,7 @@ class AssetCheckoutController extends Controller
|
||||||
$this->authorize('checkout', $asset);
|
$this->authorize('checkout', $asset);
|
||||||
$admin = Auth::user();
|
$admin = Auth::user();
|
||||||
|
|
||||||
$target = $this->determineCheckoutTarget($asset);
|
$target = $this->determineCheckoutTarget();
|
||||||
|
|
||||||
$asset = $this->updateAssetLocation($asset, $target);
|
$asset = $this->updateAssetLocation($asset, $target);
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,7 @@ class UsersController extends Controller
|
||||||
// Update the location of any assets checked out to this user
|
// Update the location of any assets checked out to this user
|
||||||
Asset::where('assigned_type', User::class)
|
Asset::where('assigned_type', User::class)
|
||||||
->where('assigned_to', $user->id)
|
->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?
|
// Do we want to update the user password?
|
||||||
if ($request->filled('password')) {
|
if ($request->filled('password')) {
|
||||||
|
|
Loading…
Reference in a new issue