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) { if (apiResponse.ok) {
const apiJson = await apiResponse.json() const apiJson = await apiResponse.json()
if (apiJson.data?.attributes) { if (apiJson.data?.attributes) {
data.map((stay: Stay) => { return data.map((stay: Stay) => {
const originalString = const originalString =
stay.attributes.confirmationNumber.toString() + stay.attributes.confirmationNumber.toString() +
"," + "," +
apiJson.data.attributes.lastName apiJson.data.attributes.lastName
let encryptedBookingValue = encryptValue(originalString) let encryptedBookingValue = encryptValue(originalString)
stay.attributes.bookingUrl = return {
fullBookingUrl + "?RefId=" + encryptedBookingValue ...stay,
attributes: {
...stay.attributes,
bookingUrl: fullBookingUrl + "?RefId=" + encryptedBookingValue,
},
}
}) })
} }
} }