fix: only invalidate cache and remove draft on successful edit
This commit is contained in:
@@ -408,7 +408,7 @@ class IndexController extends AbstractController
|
||||
'booking_id' => $id,
|
||||
'message' => $response->message,
|
||||
]);
|
||||
} else {
|
||||
} elseif (true === $response->success) {
|
||||
// Invalidate cache and clear session on success
|
||||
$this->dataLoader->invalidateBookingCache($id);
|
||||
$this->bookingService->clearBookingDto($request, BookingDto::MODE_EDIT);
|
||||
@@ -423,6 +423,15 @@ class IndexController extends AbstractController
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_booking_edit', ['id' => $id]);
|
||||
} else {
|
||||
// BookingUpdate received but success is false
|
||||
$this->addFlash('error', $response->status ?? 'Buchung konnte nicht aktualisiert werden');
|
||||
$this->logger->warning('Booking update returned unsuccessful status', [
|
||||
'email' => $email,
|
||||
'booking_id' => $id,
|
||||
'status' => $response->status,
|
||||
'valid' => $response->valid,
|
||||
]);
|
||||
}
|
||||
} catch (TimeoutException $e) {
|
||||
$this->addFlash('error', 'Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.');
|
||||
|
||||
Reference in New Issue
Block a user