From 4897453f5fd21373264649d22c8b4eeba4389a97 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Wed, 14 Oct 2015 17:19:24 +0100 Subject: [PATCH] Editing a component should call UpdateComponentCommand. Closes #1036 --- app/Http/Controllers/Dashboard/ComponentController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Dashboard/ComponentController.php b/app/Http/Controllers/Dashboard/ComponentController.php index 60df5ae0..bf61181e 100644 --- a/app/Http/Controllers/Dashboard/ComponentController.php +++ b/app/Http/Controllers/Dashboard/ComponentController.php @@ -14,6 +14,7 @@ namespace CachetHQ\Cachet\Http\Controllers\Dashboard; use AltThree\Validator\ValidationException; use CachetHQ\Cachet\Commands\Component\AddComponentCommand; use CachetHQ\Cachet\Commands\Component\RemoveComponentCommand; +use CachetHQ\Cachet\Commands\Component\UpdateComponentCommand; use CachetHQ\Cachet\Commands\ComponentGroup\AddComponentGroupCommand; use CachetHQ\Cachet\Commands\ComponentGroup\RemoveComponentGroupCommand; use CachetHQ\Cachet\Commands\ComponentGroup\UpdateComponentGroupCommand; @@ -120,7 +121,7 @@ class ComponentController extends Controller try { $componentData['component'] = $component; - $component = $this->dispatchFromArray(AddComponentCommand::class, $componentData); + $component = $this->dispatchFromArray(UpdateComponentCommand::class, $componentData); } catch (ValidationException $e) { return Redirect::route('dashboard.components.edit', ['id' => $component->id]) ->withInput(Binput::all())