fix: treat api response properly
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Controller\Booking;
|
||||
|
||||
use App\BusProNet\ApiClient;
|
||||
use App\BusProNet\Model\Notification;
|
||||
use App\BusProNet\XmlLoader\PickupLoader;
|
||||
use App\BusProNet\XmlLoader\TravelLoader;
|
||||
use App\Form\BookingType;
|
||||
@@ -93,7 +94,7 @@ class EditController extends AbstractController
|
||||
'email' => $bpnUser->getEmail(),
|
||||
'booking_id' => $id,
|
||||
]);
|
||||
if (false === $response->isSuccessful()) {
|
||||
if ($response instanceof Notification && false === $response->isSuccessful()) {
|
||||
$this->addFlash('error', $response->message);
|
||||
$this->logger->error('Error initiating booking update', [
|
||||
'email' => $bpnUser->getEmail(),
|
||||
@@ -125,4 +126,4 @@ class EditController extends AbstractController
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user