feat: improved mutability checks for personal data in edit or create mode
This commit is contained in:
@@ -106,6 +106,26 @@ class IndexController extends AbstractController
|
||||
return $agency->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels the active booking session and returns to the login page.
|
||||
*
|
||||
* This endpoint allows users to exit the booking flow at any time by
|
||||
* clearing the booking session data and redirecting them back to the
|
||||
* regular login screen.
|
||||
*/
|
||||
#[Route('/bookings/cancel', name: 'app_booking_cancel')]
|
||||
public function cancel(Request $request): Response
|
||||
{
|
||||
// Clear the booking session
|
||||
$this->bookingService->clearBookingSession($request);
|
||||
|
||||
// Add a flash message to inform the user
|
||||
$this->addFlash('info', 'Buchung abgebrochen.');
|
||||
|
||||
// Redirect to login page
|
||||
return $this->redirectToRoute('app_login');
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays user-friendly error messages for booking initialization failures.
|
||||
*
|
||||
|
||||
@@ -322,7 +322,7 @@ class IndexController extends AbstractController
|
||||
}
|
||||
|
||||
// Refresh availability data
|
||||
$availabilities = $this->travelDataService->getAvailabilityDataCached($bookingDto->travel->id);
|
||||
$availabilities = $this->travelDataService->getAvailabilityData($bookingDto->travel->id, cached: true);
|
||||
if (null !== $availabilities) {
|
||||
$this->travelDataService->patchAvailabilities($bookingDto->travel, $availabilities);
|
||||
}
|
||||
@@ -505,7 +505,7 @@ class IndexController extends AbstractController
|
||||
private function refreshFromSession(BookingDto $formData): BookingDto
|
||||
{
|
||||
// Refresh availability data
|
||||
$availabilities = $this->travelDataService->getAvailabilityDataCached($formData->travel->id);
|
||||
$availabilities = $this->travelDataService->getAvailabilityData($formData->travel->id, cached: true);
|
||||
if (null !== $availabilities) {
|
||||
$this->travelDataService->patchAvailabilities($formData->travel, $availabilities);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user