mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 13:38:20 +01:00
Remove dispatchFromArray
This commit is contained in:
parent
a4cd04fd11
commit
f072f58cb6
@ -130,8 +130,16 @@ class ComponentController extends Controller
|
||||
$tags = array_pull($componentData, 'tags');
|
||||
|
||||
try {
|
||||
$componentData['component'] = $component;
|
||||
$component = $this->dispatchFromArray(UpdateComponentCommand::class, $componentData);
|
||||
$component = $this->dispatch(new UpdateComponentCommand(
|
||||
$component,
|
||||
$componentData['name'],
|
||||
$componentData['description'],
|
||||
$componentData['status'],
|
||||
$componentData['link'],
|
||||
$componentData['order'],
|
||||
$componentData['group_id'],
|
||||
$componentData['enabled']
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.components.edit', ['id' => $component->id])
|
||||
->withInput(Binput::all())
|
||||
@ -176,7 +184,15 @@ class ComponentController extends Controller
|
||||
$tags = array_pull($componentData, 'tags');
|
||||
|
||||
try {
|
||||
$component = $this->dispatchFromArray(AddComponentCommand::class, $componentData);
|
||||
$component = $this->dispatch(new AddComponentCommand(
|
||||
$componentData['name'],
|
||||
$componentData['description'],
|
||||
$componentData['status'],
|
||||
$componentData['link'],
|
||||
$componentData['order'],
|
||||
$componentData['group_id'],
|
||||
$componentData['enabled']
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.components.add')
|
||||
->withInput(Binput::all())
|
||||
|
@ -71,8 +71,18 @@ class MetricController extends Controller
|
||||
*/
|
||||
public function createMetricAction()
|
||||
{
|
||||
$metricData = Binput::get('metric');
|
||||
|
||||
try {
|
||||
$this->dispatchFromArray(AddMetricCommand::class, Binput::get('metric'));
|
||||
$this->dispatch(new AddMetricCommand(
|
||||
$metricData['name'],
|
||||
$metricData['suffix'],
|
||||
$metricData['description'],
|
||||
$metricData['default_value'],
|
||||
$metricData['calc_type'],
|
||||
$metricData['display_chart'],
|
||||
$metricData['places']
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.metrics.add')
|
||||
->withInput(Binput::all())
|
||||
|
Loading…
x
Reference in New Issue
Block a user