diff --git a/server/routers/user/query.ts b/server/routers/user/query.ts index 13323917a..dbd6cf9b8 100644 --- a/server/routers/user/query.ts +++ b/server/routers/user/query.ts @@ -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, + }, + } }) } }