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

@@ -74,7 +74,7 @@ class IncidentUpdateController extends AbstractApiController
public function store(Incident $incident)
{
try {
$update = dispatch(new CreateIncidentUpdateCommand(
$update = execute(new CreateIncidentUpdateCommand(
$incident,
Binput::get('status'),
Binput::get('message'),
@@ -100,7 +100,7 @@ class IncidentUpdateController extends AbstractApiController
public function update(Incident $incident, IncidentUpdate $update)
{
try {
$update = dispatch(new UpdateIncidentUpdateCommand(
$update = execute(new UpdateIncidentUpdateCommand(
$update,
Binput::get('status'),
Binput::get('message'),
@@ -124,7 +124,7 @@ class IncidentUpdateController extends AbstractApiController
public function destroy(Incident $incident, IncidentUpdate $update)
{
try {
dispatch(new RemoveIncidentUpdateCommand($update));
execute(new RemoveIncidentUpdateCommand($update));
} catch (QueryException $e) {
throw new BadRequestHttpException();
}