Skip to content

Commit

Permalink
suggestions from code reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak committed Nov 11, 2024
1 parent ebb9ab9 commit 6cda5b5
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,9 @@ const NursingPlot = ({ consultationId }: ConsultationTabProps) => {
}
});

const dataToDisplay = data
.map((x) =>
x.nursing
? x.nursing.map((f) => {
return { ...f, date: x.date };
})
: [],
)
.reduce((accumulator, value) => accumulator.concat(value), []);
const dataToDisplay = data.flatMap(
(x) => x.nursing?.map((f) => ({ ...f, date: x.date })) ?? [],
);

const filterEmpty = (field: (typeof NURSING_CARE_PROCEDURES)[number]) => {
const filtered = dataToDisplay.filter(
Expand Down Expand Up @@ -269,11 +263,11 @@ export default function ConsultationNursingTab(props: ConsultationTabProps) {
breadcrumbs={false}
/>
<div>
<h4>{t("routine")}</h4>
<h4 aria-label={t("routine")}>{t("routine")}</h4>
<RoutineSection {...props} />
</div>
<div>
<h4>{t("nursing_care")}</h4>
<h4 aria-label={t("nursing_care")}>{t("nursing_care")}</h4>
<NursingPlot {...props} />
</div>
</div>
Expand Down

0 comments on commit 6cda5b5

Please sign in to comment.