chore: further cleanup and refactor
This commit is contained in:
@@ -27,7 +27,7 @@ class BookingEditDataLoader
|
||||
{
|
||||
public const string CACHE_TAG_USER_PREFIX = 'user_bookings_';
|
||||
|
||||
private bool $draftWasRestored = false;
|
||||
private bool $draftRestored = false;
|
||||
|
||||
public function __construct(
|
||||
private readonly ApiClient $apiClient,
|
||||
@@ -48,9 +48,9 @@ class BookingEditDataLoader
|
||||
* This flag is reset on each call to loadFormData() and can be used
|
||||
* by the controller to show a flash message to the user.
|
||||
*/
|
||||
public function wasDraftRestored(): bool
|
||||
public function isDraftRestored(): bool
|
||||
{
|
||||
return $this->draftWasRestored;
|
||||
return $this->draftRestored;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,7 +71,7 @@ class BookingEditDataLoader
|
||||
*/
|
||||
public function loadFormData(Request $request, int $bookingId, User $user): ?BookingDto
|
||||
{
|
||||
$this->draftWasRestored = false;
|
||||
$this->draftRestored = false;
|
||||
|
||||
$formData = $this->bookingSessionService->getBookingDto($request, BookingDto::MODE_EDIT);
|
||||
|
||||
@@ -154,7 +154,7 @@ class BookingEditDataLoader
|
||||
if (null !== $draft) {
|
||||
$applied = $this->draftService->applyDraftToDto($draft, $formData, $travelData);
|
||||
if (true === $applied) {
|
||||
$this->draftWasRestored = true;
|
||||
$this->draftRestored = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user