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

@@ -67,7 +67,7 @@ class ScheduleController extends AbstractApiController
public function store()
{
try {
$schedule = dispatch(new CreateScheduleCommand(
$schedule = execute(new CreateScheduleCommand(
Binput::get('name'),
Binput::get('message', null, false, false),
Binput::get('status'),
@@ -92,7 +92,7 @@ class ScheduleController extends AbstractApiController
public function update(Schedule $schedule)
{
try {
$schedule = dispatch(new UpdateScheduleCommand(
$schedule = execute(new UpdateScheduleCommand(
$schedule,
Binput::get('name'),
Binput::get('message'),
@@ -118,7 +118,7 @@ class ScheduleController extends AbstractApiController
public function destroy(Schedule $schedule)
{
try {
dispatch(new DeleteScheduleCommand($schedule));
execute(new DeleteScheduleCommand($schedule));
} catch (QueryException $e) {
throw new BadRequestHttpException();
}