Skip to content

Commit

Permalink
AppellationAutocomplete getOption label bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
enguerranws committed Dec 12, 2024
1 parent 037fd30 commit b043a2f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ export const AppellationAutocomplete = ({
})
: "Saisissez un métier"
}
getOptionLabel={(option) => option.appellation.appellationLabel ?? ""}
getOptionLabel={(option: AppellationMatchDto | undefined) => {
if (!option || !option.appellation) return "";
return option.appellation.appellationLabel;
}}
id={id}
renderOption={(props, option) => (
<li {...props}>
Expand Down

0 comments on commit b043a2f

Please sign in to comment.