Skip to content

Commit

Permalink
Changed redirect to reauthenticate
Browse files Browse the repository at this point in the history
  • Loading branch information
AskThomassen committed Aug 1, 2024
1 parent 10b5e66 commit 4c180b3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/orangeInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function OrangeInfoCard (props: CardProps) {
<div className="text-wrapper">
<p>No patient found with ID: {patientId}</p>
<button className="dipsPrimaryButton">
<Link className="buttonLink" href={`/searchPatient`}>
<Link className="buttonLink" href={`/`}>
Return to search
</Link>
</button>
Expand Down
4 changes: 3 additions & 1 deletion src/pages/api/patient.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { url } from "inspector";
import { NextApiRequest, NextApiResponse } from "next";

type ResponseData =
Expand All @@ -13,7 +14,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
const serverUrl = req.body.client.state.serverUrl
const URL = serverUrl + `/Patient/${patientId}`
const accessToken = req.body.client.state.tokenResponse.access_token

console.log(URL);
console.log(accessToken);
//make request to serverUrl/patient/${id} with accesstoken
const result = await fetch(URL,
{
Expand Down
2 changes: 1 addition & 1 deletion src/pages/appointments/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if (!patient) {
<div className="text-wrapper">
<p>No patient found with ID: {patientId}</p>
<button className="dipsPrimaryButton">
<Link className="buttonLink" href={`/searchPatient`}>
<Link className="buttonLink" href={`/`}>
Return to search
</Link>
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/patient/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ useEffect(() => {
<div className="text-wrapper">
<p>No patient found with ID: {patientId}</p>
<button className="dipsPrimaryButton">
<Link className="buttonLink" href={`/searchPatient`}>
<Link className="buttonLink" href={`/`}>
Return to search
</Link>
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/patientView/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const Patient: React.FC = () => {
<div className="text-wrapper">
<p>No patient found with ID: {patientId}</p>
<button className="dipsPrimaryButton">
<Link className="buttonLink" href={`/searchPatient`}>
<Link className="buttonLink" href={`/`}>
Return to search
</Link>
</button>
Expand Down

0 comments on commit 4c180b3

Please sign in to comment.