fix: add missing error handling in booking update
This commit is contained in:
@@ -86,15 +86,19 @@ class EditController extends AbstractController
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->apiClient->updateBooking($formData);
|
||||
$response = $this->apiClient->updateBooking($formData);
|
||||
|
||||
try {
|
||||
$this->cache->delete($cacheKey);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
if (false === $response->isSuccessful()) {
|
||||
$this->addFlash('error', $response->message);
|
||||
} else {
|
||||
try {
|
||||
$this->cache->delete($cacheKey);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
}
|
||||
|
||||
$this->addFlash('success', 'Buchung erfolgreich aktualisiert');
|
||||
}
|
||||
|
||||
$this->addFlash('success', 'Buchung erfolgreich aktualisiert');
|
||||
|
||||
return $this->redirectToRoute('app_booking_edit', ['id' => $id]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user