Fix command dispatching
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user