fix: apply correct return type and response handling
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Controller;
|
||||
|
||||
use App\BusProNet\ApiClient;
|
||||
use App\BusProNet\Exception\ApiClientException;
|
||||
use App\BusProNet\Model\Notification;
|
||||
use App\Form\Model\RegistrationDto;
|
||||
use App\Form\RegistrationType;
|
||||
use Psr\Log\LoggerInterface;
|
||||
@@ -34,7 +35,7 @@ class RegistrationController extends AbstractController
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
try {
|
||||
$response = $this->apiClient->register($registrationData);
|
||||
if (true === $response->isError()) {
|
||||
if ($response instanceof Notification && true === $response->isError()) {
|
||||
$this->addFlash('error', 'Möglicherweise bist du bereits registriert. Bitte setze dein Passwort zurück.');
|
||||
} else {
|
||||
$this->addFlash('success', 'Du erhältst in Kürze eine E-Mail mit einem Link zum (Zurück)setzen deines Passworts.');
|
||||
|
||||
Reference in New Issue
Block a user