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

@@ -80,7 +80,7 @@ class TeamController extends Controller
public function postAddUser()
{
try {
dispatch(new CreateUserCommand(
execute(new CreateUserCommand(
Binput::get('username'),
Binput::get('password'),
Binput::get('email'),
@@ -129,7 +129,7 @@ class TeamController extends Controller
public function postInviteUser()
{
try {
dispatch(new InviteUserCommand(
execute(new InviteUserCommand(
array_unique(array_filter((array) Binput::get('emails')))
));
} catch (ValidationException $e) {
@@ -152,7 +152,7 @@ class TeamController extends Controller
*/
public function deleteUser(User $user)
{
dispatch(new RemoveUserCommand($user));
execute(new RemoveUserCommand($user));
return cachet_redirect('dashboard.team')
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.delete.success')));