mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-31 16:37:27 -08:00
fix user api update from clearing location_id unnecessarily
This commit is contained in:
parent
30b481bc93
commit
60642cd902
|
@ -480,10 +480,11 @@ class UsersController extends Controller
|
||||||
$user->permissions = $permissions_array;
|
$user->permissions = $permissions_array;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the location of any assets checked out to this user
|
if($request->has('location_id')) {
|
||||||
Asset::where('assigned_type', User::class)
|
// Update the location of any assets checked out to this user
|
||||||
->where('assigned_to', $user->id)->update(['location_id' => $request->input('location_id', null)]);
|
Asset::where('assigned_type', User::class)
|
||||||
|
->where('assigned_to', $user->id)->update(['location_id' => $request->input('location_id', null)]);
|
||||||
|
}
|
||||||
app('App\Http\Requests\ImageUploadRequest')->handleImages($user, 600, 'image', 'avatars', 'avatar');
|
app('App\Http\Requests\ImageUploadRequest')->handleImages($user, 600, 'image', 'avatars', 'avatar');
|
||||||
|
|
||||||
if ($user->save()) {
|
if ($user->save()) {
|
||||||
|
|
Loading…
Reference in a new issue