feat: WEB-210 Updated .map to avoid mutation

This commit is contained in:
Hrishikesh Vaipurkar
2024-07-02 15:50:46 +02:00
parent cbd634144e
commit 1f53b29a69

View File

@@ -110,14 +110,19 @@ const updateStaysBookingUrl = async (
if (apiResponse.ok) {
const apiJson = await apiResponse.json()
if (apiJson.data?.attributes) {
data.map((stay: Stay) => {
return data.map((stay: Stay) => {
const originalString =
stay.attributes.confirmationNumber.toString() +
"," +
apiJson.data.attributes.lastName
let encryptedBookingValue = encryptValue(originalString)
stay.attributes.bookingUrl =
fullBookingUrl + "?RefId=" + encryptedBookingValue
return {
...stay,
attributes: {
...stay.attributes,
bookingUrl: fullBookingUrl + "?RefId=" + encryptedBookingValue,
},
}
})
}
}