Skip to content

Commit

Permalink
fix: atcToBreadcrumbs has moved
Browse files Browse the repository at this point in the history
Signed-off-by: Maud Royer <hello@maudroyer.fr>
  • Loading branch information
jillro committed Oct 11, 2024
1 parent c8d7321 commit d838d6e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/app/rechercher/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import ListItemText from "@mui/material/ListItemText";
import ListItemButton from "@mui/material/ListItemButton";
import Divider from "@mui/material/Divider";

import { atcToBreadcrumbs, formatSpecName } from "@/displayUtils";
import { Specialite, SubstanceNom } from "@/db/pdbmMySQL/types";
import { getAtcLabels } from "@/data/atc";
import { getResults } from "@/db/search";
import { formatSpecName } from "@/displayUtils";
import AutocompleteSearch from "@/components/AutocompleteSearch";

const atcData = csvParse(
Expand Down Expand Up @@ -53,16 +54,14 @@ const SubstanceResult = ({ item }: { item: SubstanceNom }) => (
</li>
);

const MedicamentGroupResult = ({
const MedicamentGroupResult = async ({
item,
}: {
item: { groupName: string; specialites: Specialite[] };
}) => {
const atc = getAtc(item.specialites[0].SpecId);
const atcBreadcrumbs = atc ? atcToBreadcrumbs(atc) : null;
const [, subClass, substance] = atcBreadcrumbs
? atcBreadcrumbs
: [null, null, null];
const atcLabels = atc ? await getAtcLabels(atc) : null;
const [, subClass, substance] = atcLabels ? atcLabels : [null, null, null];
return (
<li className={fr.cx("fr-mb-3w")}>
<ListItem component="div" sx={{ py: "0.125rem" }}>
Expand Down

0 comments on commit d838d6e

Please sign in to comment.