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 IncidentController extends AbstractApiController
public function store()
{
try {
$incident = dispatch(new CreateIncidentCommand(
$incident = execute(new CreateIncidentCommand(
Binput::get('name'),
Binput::get('status'),
Binput::get('message', null, false, false),
@@ -98,7 +98,7 @@ class IncidentController extends AbstractApiController
public function update(Incident $incident)
{
try {
$incident = dispatch(new UpdateIncidentCommand(
$incident = execute(new UpdateIncidentCommand(
$incident,
Binput::get('name'),
Binput::get('status'),
@@ -128,7 +128,7 @@ class IncidentController extends AbstractApiController
*/
public function destroy(Incident $incident)
{
dispatch(new RemoveIncidentCommand($incident));
execute(new RemoveIncidentCommand($incident));
return $this->noContent();
}