feat: load cms data early to display image on login page
This commit is contained in:
@@ -11,6 +11,7 @@ use App\Exception\NoRoomsAvailableException;
|
||||
use App\Exception\TravelNotFoundException;
|
||||
use App\Htmx\HxTrait;
|
||||
use App\Service\BookingService;
|
||||
use App\Service\BookingSummaryDataService;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -30,6 +31,7 @@ class IndexController extends AbstractController
|
||||
public function __construct(
|
||||
private readonly BookingService $bookingService,
|
||||
private readonly AgencyLoader $agencyLoader,
|
||||
private readonly BookingSummaryDataService $summaryDataService,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -63,7 +65,13 @@ class IndexController extends AbstractController
|
||||
$this->bookingService->storeReturnUrl($request, $request->query->get('r'));
|
||||
|
||||
// Create fresh booking session with the provided parameters
|
||||
$this->bookingService->startFreshBooking($request, $dateId, $hotelId, $agencyId);
|
||||
$bookingDto = $this->bookingService->startFreshBooking($request, $dateId, $hotelId, $agencyId);
|
||||
|
||||
// Warm the CMS cache early so data is available on the login page
|
||||
$this->summaryDataService->getCmsDataForProduct(
|
||||
$bookingDto->travel->productCode,
|
||||
$bookingDto->travel->hotel?->code
|
||||
);
|
||||
|
||||
// Redirect to login page (optional authentication before Step 1)
|
||||
return $this->redirectToRoute('app_login');
|
||||
|
||||
Reference in New Issue
Block a user