Merged in feat/sw-2857-refactor-booking-flow-url-updates (pull request #2302)
feat(SW-2857): Refactor booking flow url updates * Add support for removing parameters when using initial values in serializeSearchParams * Don't manually write search params in rate store * Booking is already from live search params so no need * Fix input type in serializeBookingSearchParams Approved-by: Linus Flood
This commit is contained in:
@@ -38,6 +38,9 @@ export default function Form({ close }: { close: () => void }) {
|
||||
})
|
||||
|
||||
async function getFilteredRates(packages: PackageEnum[]) {
|
||||
const bookingCode = bookingRoom.rateCode
|
||||
? bookingRoom.bookingCode
|
||||
: booking.bookingCode
|
||||
const filterRates = await utils.hotel.availability.selectRate.room.fetch({
|
||||
booking: {
|
||||
fromDate: booking.fromDate,
|
||||
@@ -46,9 +49,7 @@ export default function Form({ close }: { close: () => void }) {
|
||||
toDate: booking.toDate,
|
||||
room: {
|
||||
...bookingRoom,
|
||||
bookingCode: bookingRoom.rateCode
|
||||
? bookingRoom.bookingCode
|
||||
: booking.bookingCode,
|
||||
bookingCode: bookingCode ?? undefined,
|
||||
packages,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -33,6 +33,10 @@ export default function RoomPackageFilter() {
|
||||
|
||||
async function deleteSelectedPackage(code: PackageEnum) {
|
||||
removeSelectedPackage(code)
|
||||
const bookingCode = bookingRoom.rateCode
|
||||
? bookingRoom.bookingCode
|
||||
: booking.bookingCode
|
||||
|
||||
const filterRates = await utils.hotel.availability.selectRate.room.fetch({
|
||||
booking: {
|
||||
fromDate: booking.fromDate,
|
||||
@@ -41,9 +45,7 @@ export default function RoomPackageFilter() {
|
||||
toDate: booking.toDate,
|
||||
room: {
|
||||
...bookingRoom,
|
||||
bookingCode: bookingRoom.rateCode
|
||||
? bookingRoom.bookingCode
|
||||
: booking.bookingCode,
|
||||
bookingCode: bookingCode ?? undefined,
|
||||
packages: selectedPackages
|
||||
.filter((pkg) => pkg.code !== code)
|
||||
.map((pkg) => pkg.code),
|
||||
|
||||
Reference in New Issue
Block a user