diff --git a/app/BulkActions/Common/Dashboards.php b/app/BulkActions/Common/Dashboards.php index fbb288022..e0644d058 100644 --- a/app/BulkActions/Common/Dashboards.php +++ b/app/BulkActions/Common/Dashboards.php @@ -39,19 +39,6 @@ class Dashboards extends BulkAction ], ]; - public function enable($request) - { - $dashboards = $this->getSelectedRecords($request); - - foreach ($dashboards as $dashboard) { - try { - $this->dispatch(new UpdateDashboard($dashboard, $request->merge(['enabled' => 1]))); - } catch (\Exception $e) { - flash($e->getMessage())->error()->important(); - } - } - } - public function disable($request) { $dashboards = $this->getSelectedRecords($request); diff --git a/app/Jobs/Common/DeleteDashboard.php b/app/Jobs/Common/DeleteDashboard.php index 729582b7c..3e4b81f23 100644 --- a/app/Jobs/Common/DeleteDashboard.php +++ b/app/Jobs/Common/DeleteDashboard.php @@ -32,7 +32,7 @@ class DeleteDashboard extends Job implements ShouldDelete { // Can't delete last dashboard for any shared user foreach ($this->model->users as $user) { - if ($user->dashboards()->enabled()->count() > 1) { + if (! $this->model->enabled || $user->dashboards()->enabled()->count() > 1) { continue; }