Skip to content

Commit

Permalink
change message flash #2484
Browse files Browse the repository at this point in the history
  • Loading branch information
hmeneuvrier committed Apr 19, 2024
1 parent 72a07e6 commit ba2ca12
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Controller/Back/SignalementEditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ public function editCoordonneesBailleur(
$validationGroups[] = $signalement->getProfileDeclarant()->value;
}
$errorMessage = FormHelper::getErrorsFromRequest(
$validator, $coordonneesBailleurRequest, $validationGroups
$validator,
$coordonneesBailleurRequest,
$validationGroups
);

if (empty($errorMessage)) {
Expand Down Expand Up @@ -224,7 +226,9 @@ public function editInformationsLogement(
'EDIT_'.$signalement->getProfileDeclarant()->value;

$errorMessage = FormHelper::getErrorsFromRequest(
$validator, $informationsLogementRequest, $validationGroups
$validator,
$informationsLogementRequest,
$validationGroups
);

if (empty($errorMessage)) {
Expand Down Expand Up @@ -272,12 +276,14 @@ public function editCompositionLogement(
'EDIT_'.$signalement->getProfileDeclarant()->value;

$errorMessage = FormHelper::getErrorsFromRequest(
$validator, $compositionLogementRequest, $validationGroups
$validator,
$compositionLogementRequest,
$validationGroups
);
if (empty($errorMessage)) {
$signalementManager->updateFromCompositionLogementRequest($signalement, $compositionLogementRequest);
$response = ['code' => Response::HTTP_OK];
$this->addFlash('success', 'La composition du logement a bien été modifiée.');
$this->addFlash('success', 'La description du logement a bien été modifiée.');
} else {
$response = ['code' => Response::HTTP_BAD_REQUEST];
$response = [...$response, ...$errorMessage];
Expand Down

0 comments on commit ba2ca12

Please sign in to comment.