Skip to content

Commit

Permalink
users presenter save revert
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-stanek committed Sep 30, 2023
1 parent b17ed7c commit 3c56e73
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/AdminModule/Presenters/UsersPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ protected function createComponentAddLectorForm(): Form
$form = $this->addLectorFormFactory->create();

$form->onSuccess[] = function (Form $form, stdClass $values): void {
$this->flashMessage('admin.users.users_saved', 'success');
if ($form->isSubmitted() != $form['cancel']) {
$this->flashMessage('admin.users.users_saved', 'success');
}

$this->redirect('Users:default');
};
Expand All @@ -196,7 +198,9 @@ protected function createComponentEditUserPersonalDetailsForm(): Form
$form = $this->editUserPersonalDetailsFormFactory->create((int) $this->getParameter('id'));

$form->onSuccess[] = function (Form $form, stdClass $values): void {
$this->flashMessage('admin.users.users_saved', 'success');
if ($form->isSubmitted() != $form['cancel']) {
$this->flashMessage('admin.users.users_saved', 'success');
}

$this->redirect('this');
};
Expand All @@ -218,7 +222,9 @@ protected function createComponentEditUserSeminarForm(): Form
};

$form->onSuccess[] = function (Form $form, stdClass $values): void {
$this->flashMessage('admin.users.users_saved', 'success');
if ($form->isSubmitted() != $form['cancel']) {
$this->flashMessage('admin.users.users_saved', 'success');
}

$this->redirect('this');
};
Expand Down

0 comments on commit 3c56e73

Please sign in to comment.