From 4c180b3f8e3928bdaad838a4101c3a77ef45559f Mon Sep 17 00:00:00 2001 From: Ask Thomassen Date: Thu, 1 Aug 2024 11:18:42 +0200 Subject: [PATCH] Changed redirect to reauthenticate --- src/components/orangeInfoCard.tsx | 2 +- src/pages/api/patient.tsx | 4 +++- src/pages/appointments/[id].tsx | 2 +- src/pages/patient/[id].tsx | 2 +- src/pages/patientView/[id].tsx | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/orangeInfoCard.tsx b/src/components/orangeInfoCard.tsx index 42b5c2e..be84207 100644 --- a/src/components/orangeInfoCard.tsx +++ b/src/components/orangeInfoCard.tsx @@ -15,7 +15,7 @@ export default function OrangeInfoCard (props: CardProps) {

No patient found with ID: {patientId}

diff --git a/src/pages/api/patient.tsx b/src/pages/api/patient.tsx index dda66c4..3afc7ea 100644 --- a/src/pages/api/patient.tsx +++ b/src/pages/api/patient.tsx @@ -1,3 +1,4 @@ +import { url } from "inspector"; import { NextApiRequest, NextApiResponse } from "next"; type ResponseData = @@ -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, { diff --git a/src/pages/appointments/[id].tsx b/src/pages/appointments/[id].tsx index 9543beb..ebac267 100644 --- a/src/pages/appointments/[id].tsx +++ b/src/pages/appointments/[id].tsx @@ -70,7 +70,7 @@ if (!patient) {

No patient found with ID: {patientId}

diff --git a/src/pages/patient/[id].tsx b/src/pages/patient/[id].tsx index 7f0d421..29ff3af 100644 --- a/src/pages/patient/[id].tsx +++ b/src/pages/patient/[id].tsx @@ -184,7 +184,7 @@ useEffect(() => {

No patient found with ID: {patientId}

diff --git a/src/pages/patientView/[id].tsx b/src/pages/patientView/[id].tsx index dd74f6c..02381fd 100644 --- a/src/pages/patientView/[id].tsx +++ b/src/pages/patientView/[id].tsx @@ -104,7 +104,7 @@ const Patient: React.FC = () => {

No patient found with ID: {patientId}