Skip to content

Commit

Permalink
fix: contenu lié de type SP ne renvoient plus chez nous (#6314)
Browse files Browse the repository at this point in the history
* fix: contenu lié de type SP ne renvoient plus chez nous

* fix: handle external source

* chore: snap

* fix: TU

* chore: crap snap

---------

Co-authored-by: victor <[email protected]>
  • Loading branch information
Viczei and victor authored Nov 22, 2024
1 parent 218c423 commit 91a41f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ describe("RelatedItems", () => {
{
source: "fiches_service_public",
title: "Démission d'une assistante maternelle",
url: "https://www.service-public.fr/particuliers/vosdroits/F33164",
url: "/fiche-service-public/demission-dune-assistante-maternelle",
},
{
source: "fiches_service_public",
title: "Certificat de travail",
url: "https://www.service-public.fr/particuliers/vosdroits/F87",
url: "/fiche-service-public/certificat-de-travail",
},
{
source: "contributions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ export const fetchRelatedItems = async (
.values();

const formatted: RelatedItem[] = Array.from(filteredItems).map((item) => ({
url: item.url ?? `/${getRouteBySource(item.source)}/${item.slug}`,
url:
item.source === SOURCES.EXTERNALS
? item.url
: `/${getRouteBySource(item.source)}/${item.slug}`,
source: item.source,
title: item.title,
}));
Expand Down

0 comments on commit 91a41f9

Please sign in to comment.