diff --git a/pages/api/hold/request/[id]/edd.ts b/pages/api/hold/request/[id]/edd.ts index 29790c6b..c1617b4e 100644 --- a/pages/api/hold/request/[id]/edd.ts +++ b/pages/api/hold/request/[id]/edd.ts @@ -40,8 +40,9 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { } const holdRequestResponse = await postEDDRequest({ - ...rest, itemId, + patronId, + ...rest, }) const { requestId } = holdRequestResponse diff --git a/pages/hold/request/[id]/edd.tsx b/pages/hold/request/[id]/edd.tsx index 421c3dfc..3eb6dc46 100644 --- a/pages/hold/request/[id]/edd.tsx +++ b/pages/hold/request/[id]/edd.tsx @@ -248,7 +248,7 @@ export async function getServerSideProps({ params, req, res }) { console.error("EDD Page - Error fetching edd in getServerSideProps") } - const isEddAvailable = eddRequestable && item.isAvailable + const isEddAvailable = eddRequestable && item.isEDDRequestable const patronEligibilityStatus = await fetchPatronEligibility(patronId) @@ -262,6 +262,7 @@ export async function getServerSideProps({ params, req, res }) { discoveryItemResult, patronId, isAuthenticated, + patronEligibilityStatus, errorStatus: locationOrEligibilityFetchFailed ? "failed" : patronEligibilityStatus.status === 401 diff --git a/pages/hold/request/[id]/index.tsx b/pages/hold/request/[id]/index.tsx index 2f616f95..bbc19b47 100644 --- a/pages/hold/request/[id]/index.tsx +++ b/pages/hold/request/[id]/index.tsx @@ -94,7 +94,7 @@ export default function HoldRequestPage({ const response = await fetch(`${BASE_URL}/api/hold/request/${holdId}`, { method: "POST", body: JSON.stringify({ - patronId: patronId.value, + patronId: patronId?.value, source: source?.value, pickupLocation: pickupLocation?.value, jsEnabled: true,