Skip to content

Commit a597e13

Browse files
authored
Merge pull request #92 from swiftss-org/fix/property-of-undefined
fix: property of undefined
2 parents 7ee54bb + 9aa7fde commit a597e13

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/pages/PatientDirectory/PatientDirectory.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const PatientDirectory: React.FC = () => {
7373
<PatientsList>
7474
{patients.results.map((patient) => (
7575
<div
76-
key={`patient_${patient.national_id}_${patient.hospitals[0]?.id}`}
76+
key={`patient_${patient.national_id}_${patient.hospitals?.[0]?.id}`}
7777
css={{ marginBottom: '8px' }}
7878
>
7979
<PatientCard {...patient} />

src/pages/PatientDirectory/components/PatientCard/PatientCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const PatientCard: React.FC<PatientAPI> = ({ full_name, gender, age, national_id
2020
</Subtitle>
2121
<div css={{ display: 'flex', justifyContent: 'space-between', marginBottom: '8px' }}>
2222
<IdLabel>Patient Hospital ID:</IdLabel>
23-
<IdValue>{hospitals[0]?.patient_hospital_id}</IdValue>
23+
<IdValue>{hospitals?.[0]?.patient_hospital_id}</IdValue>
2424
</div>
2525
<div css={{ display: 'flex', justifyContent: 'space-between' }}>
2626
<IdLabel>National ID:</IdLabel>

0 commit comments

Comments
 (0)