Merged in fix/SW-3213-select-rate-page-public-prices (pull request #2596)

fix(SW-3213): Fixed booking code rates shown after removing the booking code via chip close icon

* fix(SW-3213): Fixed booking code rates shown after removing the booking code via chip close icon

* fix(SW-3213): Fixed multiroom room scenario


Approved-by: Anton Gunnarsson
This commit is contained in:
Hrishikesh Vaipurkar
2025-08-06 10:56:12 +00:00
parent 1a03b44ea8
commit d391076125

View File

@@ -6,6 +6,9 @@ import BookingCodeChip from "@/components/BookingCodeChip"
export function RemoveBookingCodeButton() {
const bookingCode = useRatesStore((state) => state.booking.bookingCode)
const roomNr = useRatesStore((state) =>
state.activeRoom !== -1 ? state.activeRoom : 0
)
const router = useRouter()
const searchParams = useSearchParams()
const pathname = usePathname()
@@ -23,6 +26,9 @@ export function RemoveBookingCodeButton() {
onClose={() => {
const newSearchParams = new URLSearchParams(searchParams)
newSearchParams.delete("bookingCode")
newSearchParams.delete(`room[${roomNr}].bookingCode`)
newSearchParams.delete(`room[${roomNr}].ratecode`)
newSearchParams.delete(`room[${roomNr}].roomtype`)
const url = `${pathname}?${newSearchParams.toString()}`