diff --git a/src/components/reservation/ReservationModalBody.tsx b/src/components/reservation/ReservationModalBody.tsx index 07ed3384a9..a8dfe601c2 100644 --- a/src/components/reservation/ReservationModalBody.tsx +++ b/src/components/reservation/ReservationModalBody.tsx @@ -7,8 +7,7 @@ import { getMaterialTypes, getManifestationType, materialIsFiction, - getReservablePidsFromAnotherLibrary, - getPatronAddress + getReservablePidsFromAnotherLibrary } from "../../core/utils/helpers/general"; import { useText } from "../../core/utils/text"; import { Button } from "../Buttons/Button"; @@ -155,7 +154,7 @@ export const ReservationModalBody = ({ } if (pidsFromAnotherLibrary.length > 0 && patron) { - const { patronId, address, name, emailAddress } = patron; + const { patronId, name, emailAddress, preferredPickupBranch } = patron; mutateOpenOrder( { @@ -163,13 +162,12 @@ export const ReservationModalBody = ({ pids: [...pidsFromAnotherLibrary], pickUpBranch: selectedBranch ? removePrefixFromBranchId(selectedBranch) - : "", + : removePrefixFromBranchId(preferredPickupBranch), expires: selectedInterest?.toString() || defaultInterestDaysForOpenOrder.toString(), userParameters: { userId: patronId.toString(), - userAddress: address ? getPatronAddress(address) : "", userName: name, userMail: emailAddress } diff --git a/src/core/utils/helpers/general.ts b/src/core/utils/helpers/general.ts index b52b3329fb..5959b22c77 100644 --- a/src/core/utils/helpers/general.ts +++ b/src/core/utils/helpers/general.ts @@ -20,7 +20,6 @@ import { dashboardReservedApiValueText } from "../../configuration/api-strings.j import { ReservationType } from "../types/reservation-type"; import { ManifestationMaterialType } from "../types/material-type"; import { store } from "../../store"; -import { AddressV2 } from "../../fbs/model"; export const getManifestationPublicationYear = ( manifestation: Manifestation @@ -573,9 +572,6 @@ export const getReservablePidsFromAnotherLibrary = ( return matchingManifestations.map(({ pid }) => pid); }; -export const getPatronAddress = (address: AddressV2) => - `${address.street}, ${address.postalCode} ${address.city}`; - export default {}; /* ********************************* Vitest Section ********************************* */