feat(SW-2116): Use refId instead of confirmationNumber
This commit is contained in:
@@ -29,9 +29,7 @@ export default function CancelStayPriceContainer() {
|
||||
const { totalAdults, totalChildren } = formRooms.reduce(
|
||||
(total, formRoom) => {
|
||||
if (formRoom.checked) {
|
||||
const room = rooms.find(
|
||||
(r) => r.confirmationNumber === formRoom.confirmationNumber
|
||||
)
|
||||
const room = rooms.find((r) => r.refId === formRoom.refId)
|
||||
if (room) {
|
||||
total.totalAdults = total.totalAdults + room.adults
|
||||
if (room.childrenInRoom.length) {
|
||||
|
||||
@@ -57,7 +57,7 @@ export default function FinalConfirmation({
|
||||
)
|
||||
} else {
|
||||
const cancelledRooms = rooms.filter((r) =>
|
||||
variables.confirmationNumbers.includes(r.confirmationNumber)
|
||||
variables.refIds.includes(r.refId)
|
||||
)
|
||||
for (const cancelledRoom of cancelledRooms) {
|
||||
toast.success(
|
||||
@@ -94,11 +94,11 @@ export default function FinalConfirmation({
|
||||
}
|
||||
|
||||
utils.booking.get.invalidate({
|
||||
confirmationNumber: bookedRoom.confirmationNumber,
|
||||
refId: bookedRoom.refId,
|
||||
})
|
||||
utils.booking.linkedReservations.invalidate({
|
||||
lang,
|
||||
rooms: bookedRoom.linkedReservations,
|
||||
refId: bookedRoom.refId,
|
||||
})
|
||||
closeModal()
|
||||
},
|
||||
@@ -113,12 +113,12 @@ export default function FinalConfirmation({
|
||||
|
||||
function cancelBooking() {
|
||||
if (Array.isArray(formRooms)) {
|
||||
const confirmationNumbersToCancel = formRooms
|
||||
const refIdsToCancel = formRooms
|
||||
.filter((r) => r.checked)
|
||||
.map((r) => r.confirmationNumber)
|
||||
if (confirmationNumbersToCancel.length) {
|
||||
.map((r) => r.refId)
|
||||
if (refIdsToCancel.length) {
|
||||
cancelBookingsMutation.mutate({
|
||||
confirmationNumbers: confirmationNumbersToCancel,
|
||||
refIds: refIdsToCancel,
|
||||
language: lang,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export default function Steps({ closeModal }: StepsProps) {
|
||||
rooms: rooms.map((room, idx) => ({
|
||||
// Single room booking
|
||||
checked: rooms.length === 1,
|
||||
confirmationNumber: room.confirmationNumber,
|
||||
refId: room.refId,
|
||||
id: idx + 1,
|
||||
})),
|
||||
},
|
||||
|
||||
@@ -57,7 +57,7 @@ export default function Confirmation({
|
||||
onSuccess: (updatedBooking) => {
|
||||
if (updatedBooking) {
|
||||
utils.booking.get.invalidate({
|
||||
confirmationNumber: updatedBooking.confirmationNumber,
|
||||
refId: updatedBooking.refId,
|
||||
})
|
||||
|
||||
toast.success(
|
||||
@@ -86,7 +86,7 @@ export default function Confirmation({
|
||||
|
||||
function handleModifyStay() {
|
||||
updateBooking.mutate({
|
||||
confirmationNumber: bookedRoom.confirmationNumber,
|
||||
refId: bookedRoom.refId,
|
||||
checkInDate,
|
||||
checkOutDate,
|
||||
})
|
||||
|
||||
@@ -41,7 +41,7 @@ export default function Form() {
|
||||
confirmationNumber: state.bookedRoom.confirmationNumber,
|
||||
currencyCode: state.bookedRoom.currencyCode,
|
||||
hotelId: state.bookedRoom.hotelId,
|
||||
refId: state.refId,
|
||||
refId: state.bookedRoom.refId,
|
||||
savedCreditCards: state.savedCreditCards,
|
||||
}))
|
||||
|
||||
@@ -85,7 +85,7 @@ export default function Form() {
|
||||
: undefined
|
||||
writeGlaToSessionStorage("yes", hotelId)
|
||||
guaranteeBooking.mutate({
|
||||
confirmationNumber,
|
||||
refId,
|
||||
language: lang,
|
||||
...(card && { card }),
|
||||
success: `${guaranteeRedirectUrl}?status=success&RefId=${encodeURIComponent(refId)}`,
|
||||
|
||||
Reference in New Issue
Block a user