Skip to content

Commit

Permalink
fix search when no appellationCode
Browse files Browse the repository at this point in the history
  • Loading branch information
celineung committed Sep 16, 2024
1 parent eb3f5a1 commit 5581820
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion front/src/app/components/search/SearchResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ const SearchResultComponent = ({
desc={establishmentName}
linkProps={{
...routes.searchResult({
appellationCode: preview ? "" : appellations[0].appellationCode,
appellationCode:
preview && appellations.length === 0
? ""
: appellations[0].appellationCode,
siret,
...(locationId ? { location: locationId } : {}),
}).link,
Expand Down

0 comments on commit 5581820

Please sign in to comment.