@@ -198,9 +193,9 @@ export function ScheduleAppointment(props: AppointmentsProps) {
{t("book_an_appointment_with")}{" "}
- {user.user_type === "Doctor"
- ? `Dr. ${user.first_name} ${user.last_name}`
- : `${user.first_name} ${user.last_name}`}
+ {userData.user_type === "doctor"
+ ? `Dr. ${userData.first_name} ${userData.last_name}`
+ : `${userData.first_name} ${userData.last_name}`}
@@ -299,7 +294,7 @@ export function ScheduleAppointment(props: AppointmentsProps) {
);
localStorage.setItem("reason", reason);
navigate(
- `/facility/${facilityId}/appointments/${staffExternalId}/patient-select`,
+ `/facility/${facilityId}/appointments/${staffId}/patient-select`,
);
}}
>
diff --git a/src/pages/Appoinments/auth/PatientLogin.tsx b/src/pages/Appoinments/auth/PatientLogin.tsx
index b4963847471..5b1ae45f76e 100644
--- a/src/pages/Appoinments/auth/PatientLogin.tsx
+++ b/src/pages/Appoinments/auth/PatientLogin.tsx
@@ -47,11 +47,11 @@ const FormSchema = z.object({
export default function PatientLogin({
facilityId,
- staffUsername,
+ staffId,
page,
}: {
facilityId: string;
- staffUsername: string;
+ staffId: string;
page: string;
}) {
const { goBack } = useAppHistory();
@@ -74,7 +74,7 @@ export default function PatientLogin({
dayjs(tokenData.createdAt).isAfter(dayjs().subtract(14, "minutes"))
) {
navigate(
- `/facility/${facilityId}/appointments/${staffUsername}/book-appointment`,
+ `/facility/${facilityId}/appointments/${staffId}/book-appointment`,
);
}
const validate = (phoneNumber: string) => {
@@ -110,11 +110,11 @@ export default function PatientLogin({
) {
Notification.Success({ msg: t("valid_otp_found") });
navigate(
- `/facility/${facilityId}/appointments/${staffUsername}/book-appointment`,
+ `/facility/${facilityId}/appointments/${staffId}/book-appointment`,
);
} else {
navigate(
- `/facility/${facilityId}/appointments/${staffUsername}/otp/verify`,
+ `/facility/${facilityId}/appointments/${staffId}/otp/verify`,
);
}
}
@@ -162,7 +162,7 @@ export default function PatientLogin({
};
localStorage.setItem(CarePatientTokenKey, JSON.stringify(tokenData));
navigate(
- `/facility/${facilityId}/appointments/${staffUsername}/book-appointment`,
+ `/facility/${facilityId}/appointments/${staffId}/book-appointment`,
);
}
},
@@ -289,7 +289,7 @@ export default function PatientLogin({
page === "send"
? goBack()
: navigate(
- `/facility/${facilityId}/appointments/${staffUsername}/otp/send`,
+ `/facility/${facilityId}/appointments/${staffId}/otp/send`,
)
}
>
diff --git a/src/pages/Facility/components/UserCard.tsx b/src/pages/Facility/components/UserCard.tsx
index 2cfe886d1c2..7ae0221e4ff 100644
--- a/src/pages/Facility/components/UserCard.tsx
+++ b/src/pages/Facility/components/UserCard.tsx
@@ -36,10 +36,10 @@ export function UserCard({ user, className, facilityId }: Props) {
Object.keys(tokenData).length > 0 &&
dayjs(tokenData.createdAt).isAfter(dayjs().subtract(14, "minutes"))
) {
- return `/facility/${facilityId}/appointments/${user.external_id}/book-appointment`;
+ return `/facility/${facilityId}/appointments/${user.id}/book-appointment`;
}
- return `/facility/${facilityId}/appointments/${user.external_id}/otp/send`;
- }, [tokenData, facilityId, user.external_id]);
+ return `/facility/${facilityId}/appointments/${user.id}/otp/send`;
+ }, [tokenData, facilityId, user.id]);
return (