Editing a component should call UpdateComponentCommand. Closes #1036

This commit is contained in:
James Brooks
2015-10-14 17:19:24 +01:00
parent ee1c23b2c9
commit 4897453f5f

View File

@@ -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())