fix: false draft-restored message
This commit is contained in:
1 parent
bfad61f1dd
commit
81b724c11a
4 files changed
+244
-5
No files matched your search
@@ -172,9 +172,11 @@ class BookingEditDataLoader
|
||||
$draft = $this->draftService->findDraft($user, $bookingId);
|
||||
if (null !== $draft) {
|
||||
$applied = $this->draftService->applyDraftToDto($draft, $formData, $travelData);
|
||||
if (true === $applied) {
|
||||
$this->draftRestored = true;
|
||||
}
|
||||
|
||||
// A draft that reproduces the API state exactly is not a restore. Reporting
|
||||
// it would tell the user their draft was restored for edits they never made.
|
||||
$this->draftRestored = true === $applied
|
||||
&& $formData->originalFingerprint !== $this->fingerprintService->generateFingerprint($formData);
|
||||
}
|
||||
|
||||
$this->bookingSessionService->saveBookingDto($request, $formData, BookingDto::MODE_EDIT);
|
||||
|
||||
Reference in new issue
Block a user