Fix command dispatching

This commit is contained in:
James Brooks
2018-06-25 22:25:54 +01:00
parent dd6bbce517
commit 8bb8ee3dc7
30 changed files with 88 additions and 73 deletions

View File

@@ -81,7 +81,7 @@ class ScheduleController extends Controller
public function addScheduleAction()
{
try {
dispatch(new CreateScheduleCommand(
execute(new CreateScheduleCommand(
Binput::get('name'),
Binput::get('message', null, false, false),
Binput::get('status', Schedule::UPCOMING),
@@ -127,7 +127,7 @@ class ScheduleController extends Controller
public function editScheduleAction(Schedule $schedule)
{
try {
$schedule = dispatch(new UpdateScheduleCommand(
$schedule = execute(new UpdateScheduleCommand(
$schedule,
Binput::get('name', null),
Binput::get('message', null),
@@ -156,7 +156,7 @@ class ScheduleController extends Controller
*/
public function deleteScheduleAction(Schedule $schedule)
{
dispatch(new DeleteScheduleCommand($schedule));
execute(new DeleteScheduleCommand($schedule));
return cachet_redirect('dashboard.schedule')
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.delete.success')));