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:
@@ -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()}`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user