From 5546ab08c2956747c7e90a29514213334359cb13 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 7 Aug 2024 19:53:18 +0100 Subject: [PATCH] Only delete user records in accessories_checkouts for bulk delete Signed-off-by: snipe --- app/Http/Controllers/Users/BulkUsersController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Users/BulkUsersController.php b/app/Http/Controllers/Users/BulkUsersController.php index fcd295ca61..489b2309bf 100644 --- a/app/Http/Controllers/Users/BulkUsersController.php +++ b/app/Http/Controllers/Users/BulkUsersController.php @@ -218,8 +218,8 @@ class BulkUsersController extends Controller } $users = User::whereIn('id', $user_raw_array)->get(); - $assets = Asset::whereIn('assigned_to', $user_raw_array)->where('assigned_type', \App\Models\User::class)->get(); - $accessories = DB::table('accessories_checkout')->whereIn('assigned_to', $user_raw_array)->get(); + $assets = Asset::whereIn('assigned_to', $user_raw_array)->where('assigned_type', User::class)->get(); + $accessories = DB::table('accessories_checkout')->where('assigned_type', User::class)->whereIn('assigned_to', $user_raw_array)->get(); $licenses = DB::table('license_seats')->whereIn('assigned_to', $user_raw_array)->get(); $consumables = DB::table('consumables_users')->whereIn('assigned_to', $user_raw_array)->get();