Skip to content

Commit

Permalink
Restore null check on patron ID for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcohen committed Dec 16, 2024
1 parent 6d90c08 commit 8b9e05b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pages/api/hold/request/[id]/edd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
}

const holdRequestResponse = await postEDDRequest({
...rest,
itemId,
patronId,
...rest,
})

const { requestId } = holdRequestResponse
Expand Down
3 changes: 2 additions & 1 deletion pages/hold/request/[id]/edd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -262,6 +262,7 @@ export async function getServerSideProps({ params, req, res }) {
discoveryItemResult,
patronId,
isAuthenticated,
patronEligibilityStatus,
errorStatus: locationOrEligibilityFetchFailed
? "failed"
: patronEligibilityStatus.status === 401
Expand Down
2 changes: 1 addition & 1 deletion pages/hold/request/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8b9e05b

Please sign in to comment.