feat: always load fresh api data when starting to edit booking

This commit is contained in:
Björn Fromme
2026-03-16 12:02:28 +01:00
parent a23ff6d119
commit fba3becb06
5 changed files with 28 additions and 7 deletions
+7 -4
View File
@@ -54,11 +54,14 @@ class BookingEditDataLoaderService
}
/**
* Loads booking data from session or initializes from API on first load.
* Loads booking data from session or initializes from API.
*
* Validates that any cached session data matches the requested booking ID.
* If a different booking is in session, it is cleared and fresh data is loaded.
* If a draft exists for this user and booking, it is automatically applied.
* Uses session data if available and valid (same booking ID). This preserves
* participant edits between form submissions within the same edit session.
*
* If no session data exists, loads fresh data from API. If a draft exists,
* it is automatically applied on top of the fresh API data to restore
* pending user edits.
*
* @param Request $request The HTTP request
* @param int $bookingId The booking ID to load