Merge pull request #3075 from CihanSenturk/fix-dashboard-bulk-action-issues
Fixed dashboard bulk action issues
This commit is contained in:
commit
e59cb8f42c
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue