Skip to content

Commit

Permalink
(Fix) O3-3250: Fix reading from undefined wardPatient (#1278)
Browse files Browse the repository at this point in the history
* fix reading from undefined wardPatient

* fix: add bottom padding on notes history container

* fix: fix tests
  • Loading branch information
usamaidrsk authored Aug 12, 2024
1 parent bad87fe commit 721bb6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

.notesContainer {
margin: layout.$spacing-04;
padding-bottom: layout.$spacing-04;
}

.notesContainerHeader {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import PatientNotesHistory from './history/notes-container.component';

const WardPatientNotesWorkspace: React.FC<WardPatientWorkspaceProps> = (props) => {
const { wardPatient, ...restWorkspaceProps } = props;
const patientUuid = wardPatient.patient?.uuid;
const { visit } = wardPatient;
const patientUuid = wardPatient?.patient?.uuid;

const notesFormState = {
patientUuid,
...restWorkspaceProps,
Expand All @@ -17,7 +17,7 @@ const WardPatientNotesWorkspace: React.FC<WardPatientWorkspaceProps> = (props) =
<div>
<WardPatientWorkspaceBanner {...wardPatient} />
<PatientNotesForm {...notesFormState} />
<PatientNotesHistory patientUuid={patientUuid} visitUuid={visit.uuid} />
<PatientNotesHistory patientUuid={patientUuid} visitUuid={wardPatient?.visit.uuid} />
</div>
);
};
Expand Down

0 comments on commit 721bb6e

Please sign in to comment.