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

@@ -62,7 +62,7 @@ class MetricController extends AbstractApiController
public function store()
{
try {
$metric = dispatch(new CreateMetricCommand(
$metric = execute(new CreateMetricCommand(
Binput::get('name'),
Binput::get('suffix'),
Binput::get('description'),
@@ -92,7 +92,7 @@ class MetricController extends AbstractApiController
public function update(Metric $metric)
{
try {
$metric = dispatch(new UpdateMetricCommand(
$metric = execute(new UpdateMetricCommand(
$metric,
Binput::get('name'),
Binput::get('suffix'),
@@ -122,7 +122,7 @@ class MetricController extends AbstractApiController
*/
public function destroy(Metric $metric)
{
dispatch(new RemoveMetricCommand($metric));
execute(new RemoveMetricCommand($metric));
return $this->noContent();
}