Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcohen committed Nov 22, 2024
1 parent 1393182 commit 1c81830
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pages/hold/confirmation/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export default function HoldConfirmationPage({
}

export async function getServerSideProps({ req, res, query }) {
const { pickupLocation, requestId } = query
// authentication redirect
const patronTokenResponse = await initializePatronTokenAuth(req.cookies)
const isAuthenticated = patronTokenResponse.isTokenValid
Expand All @@ -82,7 +83,10 @@ export async function getServerSideProps({ req, res, query }) {
redirectCount + 1
}; Max-Age=10; path=/; domain=.nypl.org;`
)
const redirect = getLoginRedirect(req, `${PATHS.HOLD_REQUEST}/${id}/edd`)
const redirect = getLoginRedirect(
req,
`${PATHS.HOLD_CONFIRMATION}?pickupLocation=${pickupLocation}&requestId=${requestId}`
)

return {
redirect: {
Expand All @@ -93,7 +97,6 @@ export async function getServerSideProps({ req, res, query }) {
}

const patronId = patronTokenResponse?.decodedPatron?.sub
const { pickupLocation, requestId } = query

try {
const { patronId: patronIdFromResponse } = await fetchHoldDetails(requestId)
Expand Down
1 change: 1 addition & 0 deletions src/types/holdPageTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface HoldPostResult {
pickupLocation?: NYPLocationKey | "edd"
formInvalid?: boolean
requestId?: string
errorMessage?: string
}

export interface HoldDetailsResult {
Expand Down

0 comments on commit 1c81830

Please sign in to comment.