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

@@ -71,7 +71,7 @@ class MetricController extends Controller
$metricData = Binput::get('metric');
try {
dispatch(new CreateMetricCommand(
execute(new CreateMetricCommand(
$metricData['name'],
$metricData['suffix'],
$metricData['description'],
@@ -115,7 +115,7 @@ class MetricController extends Controller
*/
public function deleteMetricAction(Metric $metric)
{
dispatch(new RemoveMetricCommand($metric));
execute(new RemoveMetricCommand($metric));
return cachet_redirect('dashboard.metrics')
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.delete.success')));
@@ -146,7 +146,7 @@ class MetricController extends Controller
public function editMetricAction(Metric $metric)
{
try {
dispatch(new UpdateMetricCommand(
execute(new UpdateMetricCommand(
$metric,
Binput::get('name', null, false),
Binput::get('suffix', null, false),