fix: reload booking data from API when no user edits are pending
This commit is contained in:
@@ -85,6 +85,17 @@ class BookingEditDataLoader
|
||||
return $this->initializeFromApi($request, $bookingId, $user);
|
||||
}
|
||||
|
||||
// No user edits pending — discard the session and reload live from API so that
|
||||
// BusPro-side changes (participant data, status, surcharges) are immediately
|
||||
// visible. isDirty() also returns false when originalFingerprint is null
|
||||
// (inconsistent session state), which is equally safe to reload.
|
||||
if (!$this->fingerprintService->isDirty($formData)) {
|
||||
$this->bookingSessionService->clearBookingDto($request, BookingDto::MODE_EDIT);
|
||||
$this->invalidateBookingCache($bookingId, $user);
|
||||
|
||||
return $this->initializeFromApi($request, $bookingId, $user);
|
||||
}
|
||||
|
||||
// Refresh availability and mutability data to ensure current state.
|
||||
// Availability is refreshed on every load; mutability is patched from cache.
|
||||
$this->travelDataService->enrichWithFreshAvailabilities($formData->travel);
|
||||
|
||||
Reference in New Issue
Block a user