diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index 7f52eedb2968..631819765c22 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -512,6 +512,9 @@ class ClientController extends BaseController $ids = request()->input('ids'); $clients = Client::withTrashed()->whereIn('id', $this->transformKeys($ids))->cursor(); + if(!in_array($action, ['restore','archive','delete'])) + return response()->json(['message' => 'That action is not available.'], 400); + $clients->each(function ($client, $key) use ($action) { if (auth()->user()->can('edit', $client)) { $this->client_repo->{$action}($client); diff --git a/resources/views/index/index.blade.php b/resources/views/index/index.blade.php index 4cd0f0818271..03f70989f814 100644 --- a/resources/views/index/index.blade.php +++ b/resources/views/index/index.blade.php @@ -1,12 +1,11 @@ - +