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