Skip to content

Commit

Permalink
fix(FormAnswer): redirect to FormAnswer or to list if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
stonebuzz authored and btry committed Mar 31, 2023
1 parent 7729fe2 commit 44e4ab6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions front/formanswer.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@
$formanswer->update($_POST);
Html::back();

} else if (isset($_POST['refuse_formanswer'])) {
$formanswer->update($_POST);
$formanswer->redirectToList();

} else if (isset($_POST['accept_formanswer'])) {
$formanswer->update($_POST);
$formanswer->redirectToList();

} else if (isset($_POST['refuse_formanswer']) || isset($_POST['accept_formanswer'])) {
if ($formanswer->update($_POST)) {
$formanswer->redirectToList();
}else{
//redirect to formanswer if update failed (ex : missing mandatory field)
Html::back();
}
} else if (isset($_POST['save_formanswer'])) {
if (!$formanswer->update($_POST)) {
Html::back();
Expand Down

0 comments on commit 44e4ab6

Please sign in to comment.