Skip to content

Commit

Permalink
Added a condition to ensure that only assets checked out to an user t…
Browse files Browse the repository at this point in the history
…hat is being deleted are updating their status (#9233)
  • Loading branch information
inietov authored Mar 1, 2021
1 parent 5aa9606 commit d64b35c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Users/BulkUsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function destroy(Request $request)
}

$users = User::whereIn('id', $user_raw_array)->get();
$assets = Asset::whereIn('assigned_to', $user_raw_array)->get();
$assets = Asset::whereIn('assigned_to', $user_raw_array)->where('assigned_type', 'App\Models\User')->get();
$accessories = DB::table('accessories_users')->whereIn('assigned_to', $user_raw_array)->get();
$licenses = DB::table('license_seats')->whereIn('assigned_to', $user_raw_array)->get();

Expand Down

0 comments on commit d64b35c

Please sign in to comment.