feat(ui): add enable/disable button for scheduled task

This commit is contained in:
ShadowArcanist committed 2026-03-29 15:36:32 +05:30
1 parent 1f864dc49b
commit 5037497ada
2 files changed
+18 -3

No files matched your search

@@ -111,6 +111,19 @@ class Show extends Component
}
}
public function toggleEnabled()
{
try {
$this->authorize('update', $this->resource);
$this->isEnabled = ! $this->isEnabled;
$this->task->enabled = $this->isEnabled;
$this->task->save();
$this->dispatch('success', $this->isEnabled ? 'Scheduled task enabled.' : 'Scheduled task disabled.');
} catch (\Exception $e) {
return handleError($e);
}
}
public function instantSave()
{
try {