feat: WEB-210 Updated .map to avoid mutation
This commit is contained in:
@@ -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,
|
||||||
|
},
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user